首页 > 代码库 > 拆分字符串

拆分字符串

public class zuihouyiti {

    public static void main(String[] args) {
        String s="01#张三#20*02#李四#30*03#王五#40";
        String s1=s.replaceAll("#", " ");
        System.out.println(s1.replaceAll("\\*", "\n" ));
        
    }

}

 

拆分字符串