Sunday, August 2, 2009

How would I remove the first character from a string in ASP. If I use remove I have to specify the char.?

Essentially I want to be able to remove the first character in a string. Lets say the string is a5 or b16. I want to remove the a or b. If i use replace I must specify what I want to remove.

How would I remove the first character from a string in ASP. If I use remove I have to specify the char.?
If it's always only the first character, you can use:





String.SubString(1, String.Length - 1)
Reply:It's actually simpler, although you should use a little sanity check. Given the name of the string is removeMe, here we go:





if ( removeMe.Length %26gt; 0 )


removeMe = removeMe.SubString(1);

playing cards

No comments:

Post a Comment