字符串截取?
string a = "jdbc:oracle:thin:usern/pase@192.168.123.4:1521:dse"
我要得到 String name = "usern" 和 String pass = "pase" 怎么截取?
------解决方案--------------------
string a = "jdbc:oracle:thin:usern/pase@192.168.123.4:1521:dse"
String[] b=a.split("/");
String name =b[0].lastIndexOf(":");
String pass =b[1].split("@")[0];
------解决方案--------------------
System.out.println(a.split(":")[3].split("/")[0]);
System.out.println(a.split("/")[1].split("@")[0]);