In Java, we can use the Split method (Java.lang.string.split) to split a string into a specified delimiter, and then return an array of strings, followed by an example of string.split usage and considerations.Split methodSplits a string into
Java. Lang. String. Split
Split MethodSplits a string into substrings and returns the result as a string array.
Stringobj. Split ([separator, [limit])
StringobjRequired. String object or text to be decomposed. This object will not be modified by the
Before in the http://shukuiyan.iteye.com/blog/507915 article has already described this problem, but in the last written examination actually met this knowledge point, but also did wrong, embarrassed! The Apprentice is not fine. The topic is
There is a String.Split () method in the Java.lang package, and the return is an array.1,"." and "|" is an escape character and must be added "\ \";If you use "." As a separate word, it must be written as follows:String.Split ("\ \"), in order to
PostgreSql Procedure copy split string to table, postgresqlsplit
In my scenario, there is a table with a field storing data using split string.
Although Hibernate provides org. hibernate. annotations. Type annotations, You can implement org.
[Switch] experiences in using common Java Methods
Constantly improving ing...
Java. Lang. String split
The string split method is to directly split the string according to the given string, for example
Java code
String value = "a, B, c, d, e ";
Java entry (5) -- String/string class, entry String
In the previous example, there was a String example. Some friends certainly didn't know what to do. In fact, the String class is a special class in Java, namely the String class. It is not one of
Public class stringsplit { public static void main (String [] args) { String sourceStr = " 1,2,3,4,5 "; string[] sourcestrarray = Sourcestr.split (","); for (int i = 0; i Output Result: 2413,4,5 Split's implementation
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.