java – JDK 1.4. 2 “contains (charsequences)” method in string class
•
Java
In Java 1.5, the contains (charsequences) method was added to the string class This method
How would you do this in Java versions before 1.5, especially in 1.4 In version 2?
Solution
In Java 1.4, to get the string Contains (substring) has the same effect. You can use the following code snippet:
String.indexOf(substring) != -1
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码