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


6 Years
Discussion Span
Last Post by DavidKroukamp

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

Votes + Comments
Great advice

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

Edited by JamesCherrill


@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

Votes + Comments
Irrelevant and off topic
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.