Click here to Skip to main content
16,011,578 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I have a string like my char= " thousand words"
how do I remove space from beginning of the string?

I want o/p like thousand words
Posted
Updated 26-Jan-12 22:10pm
v2
Comments
Sergey Alexandrovich Kryukov 27-Jan-12 4:30am    
What is broken? MSDN? Google? Something else?
A vote of 1 for being so lazy and wasting time.
--SA

use this -
C#
txtname.Text.TrimStart();
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 27-Jan-12 4:31am    
Well, a 5.
--SA
mayankshrivastava 27-Jan-12 4:37am    
thanks anuja..
how to do this ?
actually i m new in code project .
thatraja 27-Jan-12 5:23am    
Use Improve solution to update your question.
And for your information

Frequently Asked Questions for CodeProject.com

CPallini 27-Jan-12 5:30am    
5++. Unfortunately I can't.
Anuja Pawar Indore 27-Jan-12 6:17am    
Thanks :)
We call it String.TrimStart[^].
 
Share this answer
 
Comments
Dalek Dave 27-Jan-12 4:10am    
Dammit Carlo, beat me to it, I was busy editing.
CPallini 27-Jan-12 4:30am    
Cuique suum. :-D
Sergey Alexandrovich Kryukov 27-Jan-12 4:31am    
A 5, OP ashamed... :-)
--SA
CPallini 27-Jan-12 5:29am    
Thank you.
thatraja 27-Jan-12 5:21am    
5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900