string = "{6} 123 Main St {7} Vancouver CA {3}"
I have to find the {6} {7} {3} in the string and replace it with ' # ' ' , ' and ' ' (Hash,Comma,Space)
{6} = #
{7} = ,
{3} = ' '
That is whenever I find those numbers I have to replace them.
I did the following
string = "{6} 123 Main St {7} Vancouver CA {3}"
str = string.replace('{6}',"#");
This will show as "# 1234 Main St {7} Vancouver CA {3}"
How do I make it look like "# 123 Main St, Vancouver CA" in one sentence logic :)
If I do replace again for {7} and {3} in the abovwe string it works fine but when there are two {7} or {3} or {6} its replacing only one of the.
i,e if there are two {7} in a string it should replace two of them with ","(comma) not just one {7}
for eg: {6}4000{3} N Stemmons {7}Fwy{7} {3} Oregon {3} TX{3} 75084-8797 this should read as
#4000 N Stemmons ,Fwy, Oregon TX 75084-8797
Thanks
Start Free Trial