Remove blank spaces and make lower case

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
I would like to create a text formula that removes blank spaces and changes text to lower case. For example: 
[Field A] = New York City
[new formula field] = newyorkcity

thanks
Photo of rocketc

rocketc

  • 494 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Chris

Chris, Champion

  • 4,390 Points 4k badge 2x thumb

This formula text field removes up to four embedded spaces. You can understand the logic and add more Part() function terms if your strings have more spaces embedded.

Lower(
Left([Field to fix]," ")&Part([Field to fix],2," ")&Part([Field to fix],3," ")&Part([Field to fix],4," ")
)

(Edited)
Photo of rocketc

rocketc

  • 494 Points 250 badge 2x thumb
Ended up using a solution the Mark suggested awhile back.....

If I used:  Lower(Part([City], 1," ") & Part([City], 2," ") then New York City would become: newyork (no city)

So I had to add a few more "Parts"
Lower(Part([City], 1," ") & Part([City], 2," ") & Part([City], 3," ") & Part([City], 4," "))