on 04-01-2013 9:26 PM
Hi,
I have string which may vary in length; and i have to pick only last two char;
example: ABCDE then pick DE
XYZ then pick YZ
PQ then just pick PQ
is only UDF can help me? the substring doesnt work for this. I mean This is standard requirement. is there any way we can achive this using standrad functions?
Thanks.
check below code
String value="somestring";
if (value !=null && value.length()>=2){
String lastTwo=value.substring(value.length()-2);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.