how to split the string in java

后端 未结 10 1687
梦如初夏
梦如初夏 2020-12-11 10:44

how to split the string in java in Windows? I used Eg.

String directory=\"C:\\home\\public\\folder\";
String [] dir=direct.split(\"\\\");
         


        
10条回答
  •  一整个雨季
    2020-12-11 11:31

    String[] a1 = "abc bcd"
    String[] seperate = a1.split(" ");
    String finalValue = seperate[0];
    System.out.pritln("Final string is :" + finalValue);
    

    This will give the result as abc

提交回复
热议问题