You need to sign in to do that
Don't have an account?

Dont want last two digit, use of substring
Hi,
My Opp name is suppose "ABCD01", i want only "ABCD". How to get by using substring method.
Note: Opp name could be anything, not sure about the length. I want only last two numeric digit should be removed.
Thanx!
First.. Use the String.Length() to find the length of the string . . then use the substring .. .
String.substring(0,Length-2);
USe the other checks also . like . if (length > 2) etc..
Thanks
Ankit
hey, thanks
but one thing i didnt kept in my mind, number could be more then 3 digits as "ABCD123", that time it will return "ABCD1", but I want only string value, any idea?
hey
YOu can use the below approach but I would not say this is the best approach :-