| Reply | « Previous Thread | Next Thread » |
|
Normally in J2SE, one would use the contains() method found in the String class to verify whether the value of a particular string is present in another string.
For e.g., String a = "ecta"; and String b = "expectation"; The contains method can be easily used to verify whether the value of a is present in b in J2SE. But I think that this method is omitted in J2ME. It is unavailable. So how do I get through this problem in J2ME? Thanks for the reply. Best Regards, Nevin |
|
String.contains() wasn't added to J2SE until 1.5. It's really just a convenience, it's technically redundant. CLDC generally contains only things you really need.
In CLDC (and J2SE, prior to 1.5), you would use String.indexOf(String). Code:
boolean b = s.contains(t); Code:
boolean b = (s.indexOf(t) >= 0); Graham. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
Thank you very much Graham!
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Sending Binary Messages on 3410 phone using J2ME | affinitystudios | Mobile Java General | 3 | 2008-09-23 11:58 |
| How can the WAP browser communicate to J2ME application? | hbfornies | Mobile Java General | 20 | 2007-03-02 17:32 |
| global root overflow(please help) | sushant_125 | Mobile Java Networking & Messaging & Security | 3 | 2004-05-14 09:24 |
| TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME | girow | Mobile Java Media (Graphics & Sounds) | 0 | 2003-05-05 19:44 |
| TinyLine SVG Minute Toolkit for J2ME: version 1.4 released | girow | Mobile Java General | 0 | 2003-05-05 17:25 |