Skip to Content
0
Former Member
Apr 02, 2013 at 01:53 PM

Finding the first space in a string starting from the right of the string

525 Views

I have the following string "Chicago, ILL, 68001 USA" and I want to bring everything back from that string and put it in a variable with the exception of the USA. How do I exclude the USA. Just so that I'm clear, the end result that I want as my string is "Chicago, ILL, 68001". (I don't need the quotations) The USA could be any country, it will not always be 3 characters long. What I think I would need to do is start from the right and search for the first space going from right to left but I'm not sure how to do that.