kwh3856
asked on
C# Formatting Text - Address data
I am reading data from a table and the data from the address field varies on its format. I would like to standardize on the format of #### Upper Case first letter of the address and lower case all other characters. But if there is a second word in the address I would like to upper case that word also. What would the be the C# syntax to accomplish this task?
string address;
address.Upper(); ??????????????
string address;
address.Upper(); ??????????????
something like this.
string address = "street no. 12, place"';
string add() = address.Split(" ");
address = "";
for(int I = 0; I<=add.Length()-1; I++)
{
address += String.Left(add(i), 1).ToUpper() + String.Right(add(i).Length ()-1) + " ";
}
if any syntax error pplz correct it.
typed from phone using stylus - not tested
string address = "street no. 12, place"';
string add() = address.Split(" ");
address = "";
for(int I = 0; I<=add.Length()-1; I++)
{
address += String.Left(add(i), 1).ToUpper() + String.Right(add(i).Length
}
if any syntax error pplz correct it.
typed from phone using stylus - not tested
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
WOW from you phone...AWESOME!!!!
Thanks
Kenny
Thanks
Kenny
nice to help you!
In bus now to my native :)
Raj
In bus now to my native :)
Raj
1. you need to split address data by space.
2. loop through each splitted word and make it first caps
since I'm from mobils, I can only guide u