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

81
Vistas
How to split string with specific condition in Javascipt

I'm trying to split string with "&&" operator. but in my string there is some data with the same "&&" operator which I don't want to split. so is there any way or logic to ignore that operator for split data.

string -

let str = "countryid == 45 && (payerid==82||payerid==84||payerid==79) && (fobid!=1&&fobid!=2)"

Code -

let breakCond = str.split('&&');

Result -

0: "countryid == 45 "
1: " (payerid==82||payerid==84||payerid==79) "
2: " (fobid!=1"
3: "fobid!=2) "

Expected Result -

0: "countryid == 45 "
1: " (payerid==82||payerid==84||payerid==79) "
2: " (fobid!=1&&fobid!=2) "
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

It seems you could simply include the white spaces.

let breakCond = str.split(' && ');

If that doesn't do it than you would have to create your own version of split with its own logic.

about 4 years ago · Juan Pablo Isaza Denunciar

0

if there are always no spaces in the ones you want to keep. you can just use:

str.split(' && ')
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