Click here to Skip to main content
15,908,115 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have
string LastYearId=C2011 
string  tot= 00024

in asp.net(cs) page. I have to generate
id. i am doing like that............
string GenerateID = LastYearId.Trim()+ tot;

and output is:
GenerateID = C2011 00024 

but i don't want any space between C2011 and 00024. where i am making mistake can any one help me.
Posted
Updated 13-Apr-11 2:55am
v2

Tried something like that?
string GenerateID = LastYearId.Trim()+tot.Trim();
 
Share this answer
 
Comments
aryanbharti 13-Apr-11 8:58am    
yes i got it. thanks
Maybe you need to call Trim() on tot?

<br />
string GenerateID = LastYearId.Trim() + tot.Trim();<br />
 
Share this answer
 
Comments
aryanbharti 13-Apr-11 8:58am    
yes i got it. thanks
Whatever you are doing is correct.
Still you trim both.
string GenerateID = LastYearId.Trim() + tot.Trim();
 
Share this answer
 

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