T
tshad
I am trying to split an address into an array, such that I have a word or
"," in each array element. I also have to account for no blanks between a
word and a comma:
s = "Tustin, CA, 92780"
s.Split(' ')
This would give me:
Tustin,
CA,
92780
Since I want commas in their own element, I replace it with " , " and then
do the split:
strAddress = s.Replace(",", " , ").Split(' ');
This gives me:
Tustin
,
CA
,
92780
There is a null element after both commas. Is there a way to tell it to
split on multiple blanks as one blank or to ignore null elements?
Thanks,
Tom
"," in each array element. I also have to account for no blanks between a
word and a comma:
s = "Tustin, CA, 92780"
s.Split(' ')
This would give me:
Tustin,
CA,
92780
Since I want commas in their own element, I replace it with " , " and then
do the split:
strAddress = s.Replace(",", " , ").Split(' ');
This gives me:
Tustin
,
CA
,
92780
There is a null element after both commas. Is there a way to tell it to
split on multiple blanks as one blank or to ignore null elements?
Thanks,
Tom