S
S
Sergey2018-09-01 15:53:43
Java
Sergey, 2018-09-01 15:53:43

How to extract a portion of text from a string up to a specific character from the end of the string (JAVA)?

There is a text:
0|com.skype.raider|595162591|null|10206
I need to extract the text 10206 from it . those. All text from the end of the line to the symbol |
How can I do that? Java language

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2018-09-01
@googlgan

I think it's easier like this:

String tmp = "0|com.skype.raider|595162591|null|10206";
String[] parts = tmp.split("|");
String lastOne = parts[parts .length-1];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question