Can I use split method of String

I create a Java Service, it’s very simple. the following is my code:

String a=“a:b:c”;
a.split(":");

but it doesn’t work. when I run it In Developer 4.6, it says: “java.lang.reflect.InvocationTargetException: java.lang.String: method split(Ljava/lang/String;)[Ljava/lang/String; not found”. what’s the matter? please help me.

Toby

Hello Toby,

split method is available only in JDK 1.4. Check the JDK that you are using. It might be the lower version than 1.4.

Thanks and regards,
Pazhanikanthan. P

PP is right… split is available in JDK 1.4 and above… and AFAIK, webM version lower than 6.1 don’t use jdk 1.4.

Thx, R

Pazhanikanthan & Rohit

Thank you. you are right.

Toby,

Instead of trying to write unnecessary Java codes, why not just use pub.string:tokenize?