troubleshooting Question

Removing Leading Spaces

Avatar of Mr_Fulano
Mr_FulanoFlag for United States of America asked on
.NET ProgrammingVisual Basic.NET
10 Comments3 Solutions412 ViewsLast Modified:
Hi, I have a regular textbox (which may become a rich textbox later), where the end-user will type some text. Usually it will be a few paragraphs or less.  I would like to make sure that the text is "left aligned."  In other words I would like the text to look like this:

This is what I want the text to look like.         <<<<<<< (aligned to the left of the textbox)

       Not this, given that this has leading spaces.       <<<<<<<(has 7 leading spaces)

Other than writing my own routine to find all the leading spaces and remove them, is there a better way to accomplish what I want to do in VB.NET 2005?

BTW, I tried TRIM(textbox.text), but that didn't work.

Thanks for your help,

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros