on 06-23-2015 12:53 PM
Hello All,
I need to write an udf to find whether the given value is alphanumeric or not.
if the value is only numeric it should return '0'.
if it is any other (it might be the combination of numeric values,alphabets and also speial characters) then it should return '1'.
Thanks
Sai
I think this is the shortest code:
if (var1.matches("\\d+")) return "0"; else return "1";
More about patterns here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swetha,
Please check these links
https://scn.sap.com/thread/2058429
How to check if a String is a numeric type in Java - Stack Overflow
Regards.
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 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.