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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -