MSDN关于String的所有Method 1.字符串转字符数组 (1).ToCharArray()方法,源码如下: 调用代码: var str = "Hello World"; //将字符串转换成字符数组 var result = str.ToCharArray(); var enumerator = result.GetEnumerator(); while (enumerator.MoveNext()) { Console.WriteLine(enumerator.Current…
字符串操作 name = "alex" print(name.capitalize()) #首字母大写 name = "my name is alex" print(name.count("a")) #统计字母"a"的数量 print(name.center(50,"-")) #一共打印50个字符,变量name在中间,其余用"-"补足 print(name.endswith("…