Answers for "how to split array into string in javascript"

1

how to sepaarte text in object javascript

let data = 'Child 1 First Name: AlinChild 1 Gender: FemalenChild 1 Hair Color: BlondenChild 1 Hair Style: WavynChild 1 Skin Tone: TannChild 2 First Name: Morgan nChild 2 Gender: FemalenChild 2 Hair Color: BrownnChild 2 Hair Style: PonytailnChild 2 Skin Tone: LightnRelationship 1 to 2: BrothernRelationship 2 to 1: Brothern';
let target = {};

data.split('n').forEach((pair) => {
  if(pair !== '') {
    let splitpair = pair.split(': ');
    let key = splitpair[0].charAt(0).toLowerCase() + splitpair[0].slice(1).split(' ').join('');
    target[key] = splitpair[1];
  }
});

console.dir(target);
Posted by: Guest on May-26-2020
0

split array by character javascript

s.split("");
Posted by: Guest on December-15-2020
-2

how to saperate string to array

Scanner in=new Scanner(System.in);
		String input=in.nextLine();
		String[] word=input.split(" ");
Posted by: Guest on May-30-2020

Code answers related to "how to split array into string in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language