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

python - RuntimeError: can't re-enter readline -

python - PyInstaller UAC not working in onefile mode -

ios - Pass NSDictionary from Javascript to Objective-c in JavascriptCore -