Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
remove space between quotation and first letter
function FullName(id){
  var firstName = getColumn("Olympic Medals", "Athlete First Name");
  var lastName = getColumn("Olympic Medals", "Athlete Last Name");
  var ID = getColumn("Olympic Medals", "id");
  for(var i=0; i<firstName.length; i++){
    if(ID[i] == id){
      return firstName[i] + " "+ lastName[i];
    }
  }
  
  return "Not found";
}

This code combines the full name and last name of a person based on their id number.

console.log (FullName("1", true));

When I used console.log to check whether the full name is correctly written, I found that there is a space between the quotation mark and the first letter, like this: " Alexandre Despatie" .Can anyone help me to remove the unwanted space?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

use .trim()

function FullName(id){
  var firstName = getColumn("Olympic Medals", "Athlete First Name");
  var lastName = getColumn("Olympic Medals", "Athlete Last Name");
  var ID = getColumn("Olympic Medals", "id");
  for(var i=0; i<firstName.length; i++){
    if(ID[i] == id){
      return (firstName[i] + " "+ lastName[i]).trim();
    }
  }
  
  return "Not found";
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda