1. Get the file name
Get the filename, that is, remove the file suffix/** * mypic.jpg * Get the file name * 1. First find the "." The location of * 2. Intercept from the first character to "." The location of */string name = "mypic.jpg"; int index = Name.indexof ("."); String subname = name.substring (0, index); System.out.println (SubName); Mypic
2. Intercepting the contents of the HTTP substring in content
String content = "integer Index1 = Uri.indexof ("src="); First find the location of the src= integer index2 = Uri.indexof (":", index1 + 5); Starting with "src=", intercept the first colon string id = uri.substring (index1 + 5, INDEX2); Get results
int index = Str.indexof ("src="); Returns the position of the first letter of the src= in the current string, starting with 0
uri.indexof (":", index1 + 5); starting at the position of subscript 5, gets the position where the ":" appears for the first time. that is, the element is retrieved from the specified position.
Java.lang.String string manipulation