on 06-26-2009 9:05 AM
Hi,
I am using a UDF to take substring of my value from source (source value is of format abcd/xyz). Now I want to check if there exists any value before "/" i.e. I want to check if there is any value before "/" . I tried using the .length function, but due to some reason I am not able to get it working. So please tell me how to get the below UDF working:
public String getUser1Id(String Id, Container container) throws StreamTransformationException{
String logName = Id;
int len = logName.indexOf("/");
logName = logName.substring(0,len);
return logName;
Id is the input from the source (abcd/xyz) into the UDF.
Thanks.
Hi,
your code is working if you have "/" in your ld parameter. Another point is your function returns left of '/' in your input. Is this your requirement or returning true or false depending on the existence of anything before '/'?
Kind Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got the UDF working. Used logName.length()!=0;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.