on 08-06-2008 3:40 PM
Hi ,
I have written a basic Java UDF to calculate the length of the incoming string without counting the whitespace(blanks) in this string.
In the code below I am trying to add the character count of string to a global container gw_len.
//write your code here
int i = a.length();
String b="";
Char c;
for (int j=0; j<i; j++)
{
c=a.charAt(j);
if (c!=' ')
gw_len = gw_len + 1;
}
return a;
However upon activation I get the following error:
Source code has syntax error: D:/usr/sap/XRD/DVEBMGS02/j2ee/cluster/server0/./temp/classpath_resolver/Map6b95a7e063c511ddb480001a4b52813a/source/com/sap/xi/tf/_MM_ALLOCATION_RESPONSE_.java:384: incompatible types found : char required: java.lang.String c=a.charAt(j); ^
D:/usr/sap/XRD/DVEBMGS02/j2ee/cluster/server0/./temp/classpath_resolver/Map6b95a7e063c511ddb480001a4b52813a/source/com/sap/xi/tf/_MM_ALLOCATION_RESPONSE_.java:385: operator != cannot be applied to java.lang.String,char if (c!=' ') ^
2 errors
Can you Java experts help let me know where my code is wrong.
Thanks
Shirin
Hi,
You can even do this using the standard graphical mapping function.
Use this mapping pattern http://www.flickr.com/photos/28929439@N06/2740038189/
Thanks
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solved.
Changed 'Char' to 'char' and problem solved.
Regards
Shirin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
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.