Split address by first comma after street address

In C# ASP.NET, I want to take a full comma delimited address string and split it by the first comma which will come after the street address, and add a line break to it for html output. Hopefully a super easy question. Thanks.
LVL 9
BobHavertyComhAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

McOzCommented:
This would be a simple case of replacing the first occurrence of comma with line break. You can use regex for this, as shown in this link:

http://stackoverflow.com/questions/8809354/replace-first-occurrence-of-pattern-in-a-string
BobHavertyComhAuthor Commented:
Do you know how this is done in C# ASP.NET? I need to do it server side.
Lokesh B RDeveloperCommented:
Hi,

Can you post the sample data and expected output?
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

BobHavertyComhAuthor Commented:
332 anywhere street, anywhere, ny

I want

332 anywhere street<br>
anywhere, ny

Sorry if I didn't explain it clearly.
Lokesh B RDeveloperCommented:
Hi,

Check the sample code here

           
string address = "332 anywhere street, anywhere, ny";
            int index = address.IndexOf(",");
            if (index > 0)
            {
                address = address.Insert(index + 1, "<br>");
            }

Open in new window

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
BobHavertyComhAuthor Commented:
Yup, that will work. Thanks.
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
ASP.NET

From novice to tech pro — start learning today.