How to get data from array to string JAVA? -


i have array looks this:

ss="date:03/27/2017,text=sample,date:03/28/2017" 

but want 03/27/2017 array 1 string how possible in java?

you use split method, take look:

string ss="date:03/27/2017,text=sample,date:03/28/2017"; string date = ss.split(",")[2].split(":")[1]; system.out.println(date);//03/28/2017 

step-by-step

ss.split(",");//[date:03/27/2017, text=sample, date:03/28/2017] ss.split(",")[2];//date:03/28/2017 ss.split(",")[2].split(":");//[date, 03/28/2017] ss.split(",")[2].split(":")[1];//03/28/2017 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -