字符串的常用操作 # Author:nadech name = "my name is nadech" print(name.count("a")) print(name.capitalize()) print(name.center(50,"-")) print(name.ljust(50,'-')) print(name.rjust(50,"-")) print(name.find("name"))#找…
/** * THis_is_a_cat * This Is A Cat * * Cat A Is This * @author Administrator * */ public class Test07Str { public static void main(String[] args) { String s="THiS_is_a_cat"; //拆分 String[] arr =s.split("_"); //声明新的字符串 // String sumStr=…