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(); ??????????????

kwh3856OwnerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rajkumar GsSoftware EngineerCommented:
create a function implementing these logic

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

Rajkumar GsSoftware EngineerCommented:
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
Rajkumar GsSoftware EngineerCommented:
>>  Upper Case first letter of the address and lower case all other characters

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).ToLower() + " ";
}

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kwh3856OwnerAuthor Commented:
WOW from you phone...AWESOME!!!!


Thanks
Kenny
Rajkumar GsSoftware EngineerCommented:
nice to help you!

In bus now to my native :)

Raj
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.