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

185
Views
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 answers
Answer question

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 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!