Answer the question
In order to leave comments, you need to log in
How to split input value into 3 parts?
There is 1 input, Surname [space] First name [space] Middle name are entered there.
The data is entered into 3 different lines separated by a space.
those.
Ivanov Ivan Ivanovich
Your Surname : Ivanov
Your Name : Ivan
Your Patronymic : Ivanovich
I don't understand how to do it, I couldn't find it in Google. I'm doing it in react.
please tell me the algorithm
Answer the question
In order to leave comments, you need to log in
var names = 'Иванов Иван Иванович';
console.log(names);
var re = /\\s+/;
var nameList = names.trim().split(re);
console.log(nameList);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question