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

186
Vistas
React Native Formatting User Address String

I'm trying to format an address string in React Native.

The address string data given is 123 STREET, 123 CITY, PROVINCE 123

and I want to show only PROVINCE 123

What should I do.

Any help will be appreciated

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

0

if the address format is consistent, you could do this:

const address = "123 STREET, 123 CITY, PROVINCE 123"
const province = address.split(', ')[2]

the split function .split(', ') turns the string into an array of substrings and use ', ' as the separator, which return an array like this

["123 STREET","123 CITY","PROVINCE 123"]

then just access the index of the province, you could do this if only the format is consistent (street and city must be provided or at least an empty string just to keep the format street-name, city-name, province-name)

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