Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda