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

105
Views
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 answers
Answer question

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 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!