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

218
Views
¿Cómo podría configurar el separador múltiple de "_.truncate" de Lodash?

¿Cómo puedo separar por "," o "-" o " " ?

 let _r = _.truncate('hi-diddly-ho there, neighborino', { 'length': 16, 'separator': /,- +/ }); console.log(_r); //need output: hi let _r = _.truncate('hi!diddly ho there, neighborino', { 'length': 16, 'separator': /,- +/ }); console.log(_r); //need output: hi!diddly let _r = _.truncate('hi!diddly!ho,there, neighborino', { 'length': 16, 'separator': /,- +/ }); console.log(_r); //need output: hi!diddly!ho

si la configuración "/,- +/" no funciona, ¿qué debo hacer?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Su expresión regular básicamente dice, "coincidir ,- seguido de al menos un espacio".

Compruébalo en Regex101

Esto coincidiría con ",- " , por ejemplo.

Lo que desea es un grupo de caracteres de , , - y espacio (tenga en cuenta que debe escapar - allí):

 /[,\- ]/

Compruébalo en Regex101

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!