private void button3_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
string str = "686B666B686B666B706B5D9BACAFA0AC5D683532303833393737";
for ( int i = ; i < str.Length; i++)
{
if (i % == ) //奇数 ...1
{
sb.Append(str[i]);
sb.Append(" ");
continue;
}
sb.Append(str[i]);
}
var result = sb.ToString();
}

//指定数据前移

    strlist = new string[] { "","A","", "B" };

            for (int i = ; i < strlist.Length; i++)
{
//空数据 前移
if (strlist[i] == "")
{
test(strlist, i);
}
}
public void test(string[] strlist, int index)
{
for (int i = index; i < strlist.Length; i++)
{
if (i + >= strlist.Length)
{
strlist[i] = ""; //要替换的值
continue;
}
strlist[i] = strlist[i + ];
}
}

ssid

        private void button3_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
string str = "686B666B686B666B706B5D9BACAFA0AC5D683532303833393737";
for (int i = ; i < str.Length; i++)
{
if (i % == ) //奇数 ...1
{
sb.Append(str[i]);
sb.Append("\r\n");
continue;
}
sb.Append(str[i]);
}
string result = sb.ToString();
string[] strlist = result.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);//返回值不包含空字符串元素, //去掉第三个和第7个 3=(i+1) i=2 第三个是2; 第七个是6; 取前8个字节
strlist[] = ""; strlist[] = ""; for (int i = ; i < strlist.Length; i++)
{
//空数据 前移
if (strlist[i] == "")
{
test(strlist, i);
}
} List<string> list = new List<string>();
for (int i = ; i < strlist.Length; i++)
{
list.Add(strlist[i]);
if (i == ( - ))
{
break;
}
}
//--减去37+30 = 67;
sb.Length = ;
for (int i = ;i<list.Count;i++)
{ var t = Convert.ToInt32(list[i]) - ; sb.Append(t); } } public void test(string[] strlist, int index)
{
for (int i = index; i < strlist.Length; i++)
{
if (i + >= strlist.Length)
{
strlist[i] = ""; //要替换的值
continue;
}
strlist[i] = strlist[i + ];
}
}

private void button3_Click(object sender, EventArgs e)        {            StringBuilder sb = new StringBuilder();            string str = "686B666B686B666B706B5D9BACAFA0AC5D683532303833393737";            for (int i = 0; i < str.Length; i++)            {                if (i % 2 == 1) //奇数 ...1                {                    sb.Append(str[i]);                    sb.Append("\r\n");                    continue;                }                sb.Append(str[i]);            }            string result = sb.ToString();            string[] strlist = result.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);//返回值不包含空字符串元素,
            //去掉第三个和第7个 3=(i+1) i=2 第三个是2; 第七个是6;  取前8个字节            strlist[2] = ""; strlist[6] = "";
            for (int i = 0; i < strlist.Length; i++)            {                //空数据 前移                if (strlist[i] == "")                {                    test(strlist, i);                }            }
            List<string> list = new List<string>();            for (int i = 0; i < strlist.Length; i++)            {                list.Add(strlist[i]);                if (i == (8 - 1))                {                    break;                }            }            //--减去37+30 = 67;            sb.Length = 0;            for (int i = 0;i<list.Count;i++)            {
                var t = Convert.ToInt32(list[i]) - 67;
                                sb.Append(t);
            }

}
        public void test(string[] strlist, int index)        {            for (int i = index; i < strlist.Length; i++)            {                if (i + 1 >= strlist.Length)                {                    strlist[i] = ""; //要替换的值                    continue;                }                strlist[i] = strlist[i + 1];            }        }

C# 字符串每隔两个 提取的更多相关文章

  1. JS中substring()方法(用于提取字符串中介于两个指定下标之间的字符)

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  2. JS对象 substring() 方法用于提取字符串中介于两个指定下标之间的字符。

    提取字符串substring() substring() 方法用于提取字符串中介于两个指定下标之间的字符. 语法: stringObject.substring(starPos,stopPos)  参 ...

  3. substring() 方法用于提取字符串中介于两个指定下标之间的字符。

    substring() 方法用于提取字符串中介于两个指定下标之间的字符. 语法 stringObject.substring(start,stop) 参数 描述 start 必需.一个非负的整数,规定 ...

  4. JS 从一个字符串中截取两个字符串之间的字符串

    /************************************************* 函数说明:从一个字符串中截取 两个字符串之间的字符串 参数说明:src_str 原串, start ...

  5. SPOJ PHRASES 每个字符串至少出现两次且不重叠的最长子串

    Description You are the King of Byteland. Your agents have just intercepted a batch of encrypted ene ...

  6. Js 字符串拼接的两种方法

    字符串拼接的两种方法 用数组的方法的好处是:避免变量重新定义.赋值 <!DOCTYPE html> <html lang="en"> <head> ...

  7. 简单实现textview文本每隔两秒就改变一次

    //这个方法可以实现文本每隔两秒就改变一次, public void textTask(){ final android.os.Handler handler=new android.os.Handl ...

  8. C++读取字符串数据的两种方式

    C++读取字符串数据的两种方式 对于同样的样例输入: ladder came tape soon leader acme RIDE lone Dreis peat ScAlE orb eye Ride ...

  9. python3 练习题100例 (二十二)输入两个字符串,输出两个字符串集合的并集

    题目内容: 输入两个字符串,输出两个字符串集合的并集. 为保证输出结果一致,请将集合内元素排序之后再输出, 如对于集合aset,可输出sorted(aset). 输入格式: 共两行,每一行为一个字符串 ...

随机推荐

  1. div拖拽缩放jquery插件编写——带8个控制点

    项目中需要对div进行拖拽缩放,需要有控制面板8个控制点的那种,原以为这么常见的效果应该能搜索到很多相关插件,然而可以完成拖拽的实繁,却找不到我想要的,还是自己动手丰衣足食吧 效果预览(只支持pc端) ...

  2. jq 常用手册

    1.替换标签 $("img[src='/_layouts/images/lstbulet.gif']").attr("src", "/huadong/ ...

  3. powerShell赋权限

    1.给网站赋权限 Set-SPUser –Identity “用户名” –AddPermissionLevel “参与讨论” –web “http://url” 2.给列表赋权限 $web = Get ...

  4. 利用SEH进行代码混淆

    这几天在重看SEH机制,收获颇丰. 随手写了一个用SEH进行跳转的代码贴于此处以作纪念. 当发生异常,并捕捉了异常.在OS的异常处理机制下.会进入异常过滤函数. 过滤函数能够返回EXCEPTION_E ...

  5. 告诉大家我是如何在14:00秒杀到 《深入理解Bootstrap》

    1.打开火狐,不用IE,3个评论窗口,层叠在一起,可以点击3次哦. 2.打开一个百度的现在时间,不能看你本机的时间,要互联网的时间. 3.等时间到13:59:59,开始依次点击按钮,总有你预想不到的结 ...

  6. https://security.stackexchange.com/questions/68405/what-is-tmunblock-cgi-and-can-it-be-exploited-by-shellshock-linux-apache-w

    hndUnblock.cgi   Line #1124 : 187.38.233.45 - - [15/Jan/2018:21:36:45 +0800] "GET /hndUnblock.c ...

  7. 蓝桥 PREV-34 历届试题 矩阵翻硬币

      历届试题 矩阵翻硬币   时间限制:1.0s   内存限制:256.0MB      问题描述 小明先把硬币摆成了一个 n 行 m 列的矩阵. 随后,小明对每一个硬币分别进行一次 Q 操作. 对第 ...

  8. Mac系统打开命令行终端及查看操作系统版本号的方法

    Mac系统打开命令行终端的方法: 应用程序 --> 实用工具 --> 终端 Mac系统终端查看操作系统版本号的方法: 输入:#more /System/Library/CoreServic ...

  9. ANT-普通替换和正则替换

    ant提供了两个指令用于编译时修改文件,好处就不说了 ,就说说如何使用吧. replaceregexp 和 replace的区别就和java中String replace和replaceAll一样 , ...

  10. bzoj 4883 棋盘上的守卫 —— 基环树转化

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4883 首先,注意到每个点可横可竖,但花费一样: 所以考虑行列的交集,那么这个条件可以转化为行 ...