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

Popular posts from this blog

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

Why does PHP consider 0 to be equal to a string? -

formula - R: how to pass in a reference to the variable in glm or lm? -