Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda