Java: Get last element after split -


I am using string split method and I want the last element to change the size of the array.

Example:

  String one = "Düsseldorf - Jätrrum - Günevieve Yübak" String two = "Düsseldorf - Madison"  < / Pre> 

I want to split the above stars and get the last item:

  lastone = one.split ("-") [last item here]  

I do not know the size of the array on rum times: (

< P>

string [] bits = A. Split ("-"); string endone = bits [bits] long-1];


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -