I understand you want to pick up a piece of a string so...
You can transform the string into an array by separating the elements by spaces:
var teste = "02/10/2017 a 05/10/2017";
var arrayTeste = teste.split(' ');
This will return an array with 3 elements:
0- 02/10/2017
1- a
2- 05/10/2017
You can pick them up separately:
arrayTeste[0];
arrayTeste[1];
arrayTeste[2];
If you want you can still use the split('/') to separate the day, month and year
Comments:
The first element has position 0, the second position 1 so on
The elements will no longer have the space character ( ) because the split deletes it to separate the elements of the array
I recommend watching the videos of the white Rodrigo - https://www.youtube.com/user/rodrigobranas he has videos about js, Angularjs and nodejs
You can’t just use a substring ?
– Bruno
No, the return varies in size, precise of the first occurrence of the same
– gabrielfalieri
This gives an idea of how I suggested: var textDoRetorno = "02/10/2017 a 05/10/2017 em São Paulo - Papercut MF Técnico Presencial (28 hrs) - Vagas disponível"; console.log("PRIMEIRA OCORRENCIA :"+textDoRetorno.substring(0, textDoRetorno.indexof("A"))); The return, you want some input from the letter "A" or the contents until the first occurrence ?
– Bruno