java - Edit string array elements -
my array this:
"keys": [ "first name", "second name", "date of birth", "name", "tle no", "other details" ]
i want re-arrange above array data this:
"keys": [ "first_name", "second_name", "date_of_birth", "name", "tle_no", "other_details" ]
i want create using java code. how can create it?
use string.replaceall()
method:
for (int = 0; < keys.length; i++) { keys[i] = keys[i].replaceall(" ", "_"); }
reference: replaceall
Comments
Post a Comment