标签:test 输出 color size public 取出 dfs fss int
String str = lly://enterVideoList?result={jsonString};
截取?之前字符串
String str1=str.substring(0, str.indexOf("?"));
截取?之后字符串
String str1=str.substring(0, str.indexOf("?"));
String str2=str.substring(str1.length()+1, str.length());
取出正数第二个“.”后面的内容
public class TestCode { public static void main(String[] args) { String str ="232ljsfsf.sdfl23.ljsdfsdfsdfss.23423.sdfsdfsfd"; //获得第一个点的位置 int index=str.indexOf("."); System.out.println(index); //根据第一个点的位置 获得第二个点的位置 index=str.indexOf(".", index+1); //根据第二个点的位置,截取 字符串。得到结果 result String result=str.substring(index); //输出结果 System.out.println(result); } }
标签:test 输出 color size public 取出 dfs fss int
原文地址:https://www.cnblogs.com/kkxwze/p/11224693.html