on 08-31-2009 3:44 PM
Java Experts,
How to convert XSD:String type as an input variable to an array in UDF?
Thanks!
MP
I choose the option to 'Queue' for UDF.
public void test2(String[] inputList,ResultList result,Container container){
int charLimit = 132;
char[] stringTochars = inputList.toCharArray();
boolean endOfString = false;
int start = 0;
int end = start;
while(start < stringTochars.length-1) {
int lastSpace = 0;
for (int charCount = 0 ; charCount < charLimit ; charCount++) {
if(stringTochars[charCount+start] == ' ') {
lastSpace = charCount;
}
if(charCount+start == inputList.length()) {
endOfString = true;
break;
}
}
if (endOfString) {
end = inputList.length();
} else if (lastSpace > 0) {
end = lastSpace+start;
} else {
end = charCount+start;
}
result.addValue(inputList.substring(start, end));
start = end+1;
}
}
I am getting syntax error as follows:
cannot resolve symbol symbol : method toCharArray () location: class java.lang.String[] char[] stringTochars = inputList.toCharArray();
Thank you,
MP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jose... It worked!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi MP
Can you explain more clearly?. All pararameters are in String.
if you want to receive as an array choose the option en Queue in your UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What do you want to do exactly? pls, give us more details.
Regards
Ivan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.