标签:ica task bre replace space gen name lin console
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
string str = " The major reason for the good performance of the good algorithm is that the incorporation of the multhe tioperator strategy helps to select good crossover operators.";
Console.WriteLine(str.Length);
string[] str1 = str.Split(‘ ‘);
for (int a = 1; a < str1.Length; a++)
{
Console.Write(str1[a][0]+" ");
}
Console.WriteLine();
string str2 = str.Replace("of", "OF");
Console.WriteLine(str2);
int i = str.IndexOf(" tioperator");
string str3 = str.Remove(i, 11);
Console.WriteLine(str3);
int j = 0;
while (j < str.Length)
{
j = str.IndexOf("good", j);
if (j == -1)
{
break;
}
Console.WriteLine(j);
j++;
}
int k = str.IndexOf(" strategy");
string str4 = str.Insert(k, " the");
Console.WriteLine(str4);
}
}
}
标签:ica task bre replace space gen name lin console
原文地址:http://www.cnblogs.com/zhaohaijie/p/6547059.html