用C#写的字符串处理函数,字符串处理出BUG的朋友可以使用它。较上一个版本修正了一处bug,并增加了ReplaceAll方法。
用法: 编译时添加引用/r:d:/path/MyStringDll1.2.dll 代码示例: using Falls27.Utils; MyString ms=new MyString(); //初始化 Console.WriteLine(ms.IndexOf("hello world","l",5)); //输出9 Console.WriteLine(ms.Substring("hello world",1,6)); //输出“ello w" Console.WriteLine(ms.ReplaceLast("hello world","l","*")); //输出”hello wor*d" Console.WriteLine(ms.ReplaceAll("hello world","l","*")); //输出”he**o wor*d" ArrayList list=ms.GetPosList("hello world","l"); foreach(int pos in list){ Console.WriteLine("" + pos); } //输出2,3,9