Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
¿Cómo dividir una cadena en una matriz sin usar Array.split?

¿Es posible implementar Array.split() simplemente usando bucles sin usar ninguna función integrada?

Quiero esto: "Hello how are you" ---> ["Hello" , "how", "are", "you"] sin usar Array.split() ni ninguna función integrada.

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

prueba esto

 let str= "Hello how are you"; let array = ['']; let j = 0; for (let i = 0; i < str.length; i++) { if (str.charAt(i) == " ") { j++; array.push(''); } else { array[j] += str.charAt(i); } } console.log(array)

about 4 years ago · Santiago Gelvez Report

0

let word = "stack over flow murat"; let arr = [] let tempWord= "" for (let i = 0; i<word.length; i++){ if(word[i]===" "){ arr.push(tempWord); tempWord=""; } else{ tempWord+=word[i]; } } arr.push(tempWord); console.log(arr);
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!