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

122
Vistas
How to remove alphabets and special character form string

My input is string contains character and special symbol, I need only numeric value output so how can we do that using Node JS. const myInput = "56,57FS+2d" //desired output is 56,57

For character not fixed with FS it will be change. Thanks in advance.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Use regex /[a-zA-Z](.*)/g

const myInput = "56,57FS+2d";
console.log(myInput.replace(/[a-zA-Z](.*)/g, ''))

about 4 years ago · Juan Pablo Isaza Denunciar

0

Try this, this will select all numbers and , and remove everything after + (here +2d).

const myInput = "56,57FS+2d";
console.log(myInput.replace(/[^0-9,][^+]{0,}/g, ""));

Output:

56,57
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