Hi All
I wanted to write string.contains() in jdk 1.4, but i know 1.4 doesn't support contains is there any way to do the same

ex: if the string contains "," i want check the condition
String name;
if(name.contains(",")) is there any way to do in jdk 1.4

Regards
Ravi

It's very dangerous to be on 1.4 - you are missing many years of essential security fixes (not to mention language enhancements). Your computer is at risk. You really should update to 1.7 immediately

commented: Great advice +0

since a lot of companies haven't switched to 7 yet, version 6 I can understand, but as JamesCherrill says: it's risky.

anyway, you may want to try the indexOf method

fair point.
@raviaaaa: You really should update to 1.7 (or the latest version sanctioned by your college/employer) immediately

@stultuske, java has been exposed to having many flaws, leading to a great number of malware infections, which is still on the rise due to Java not being updated on many PC's. But I guess as lonh as you have a Good AV even though a virusmay use an exploit fom Java 6 the AV will catch it, but why risk it I guess is the question

commented: Irrelevant and off topic -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.