on 11-06-2007 8:37 AM
Hi All,
I have a field where in i get the input as AY;RYANBROS;HQ (the source length can vary)
now i want to remove the ; and split the ignore the source after the second occurance of ;
so for this i have written a udf taking one stirng a,
a.replaceFirst(";","").split(";")[0];
But i am getting an error as....
Source code has syntax error: /usr/sap/XD1/DVEBMGS81/j2ee/cluster/server0/./temp/classpath_resolver/Mape219e3f08c4211dc9f790018714e8238/source/com/sap/xi/tf/_IDD088_SCV_to_SAP_LOC_ORG_MM_.java:1376: not a statement a.replaceFirst(";","").split(";")[0]; ^ 1 error
I am not a java programmer..can you please help.
Rgds,
Kumar
Hi Kumar,
try this
String<i>[]</i> inputArr = input.split(";");
String output = inputArr<i>[0]</i>+inputArr<i>[1]</i>;
return output;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi varun
with u r code i am getting error as
/usr/sap/XD1/DVEBMGS81/j2ee/cluster/server0/./temp/classpath_resolver/Map52ba13e08c4911dc9c9c0018714e8238/source/com/sap/xi/tf/_IDD088_SCV_to_SAP_LOC_ORG_MM_.java:1381: cannot resolve symbol symbol : variable input location: class com.sap.xi.tf._IDD088_SCV_to_SAP_LOC_ORG_MM_ String[] inputArr = input.split(";"); ^ 1 error
Rgds,
Kumar
Hi Kumar
String s2 = "AY;RYANBROS;HQ";
String result = "";
String[] s3 = s2.split(";");
for (int i = 0; i < 2; i++) {
result = result + s3<i>;
}
return result;
I given i<2 because u only need first two string of ; seperation.
<b>*****rewrds point if helpfull</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
What is the string u need to extract for the input AY;RYANBROS;HQ.?
Regards
San
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
kumar
did u try this code in NWDS or in any of the java editor such as eclipse? if not check the code out there and u can get it right
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.