How to get the (n) index of characters in a string?
•
Java
Suppose you have a string like this:
String longStr="someText1@someText2@someText3@someText@someText4@someText5@someText6@someText7@someText8@someText9@someText10@someText11@someText12@someText13@someText14";
How to get the index of the 10th @ character in the above string?
I need the index to split from the index to the end
Solution
You can use stringutils Ordinalindexof() finds the nth index in a string
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
二维码