Hi guys
Im pretty new to java after programming with python for about a year i thought i'd give it a go. I did have a quick question though.
How would i check for membership in a string.
For example

String str1="Hello world";
String str2 = "world";

Is there any way to check if str2 in str1?

Thanks!

Is there any way to check if str2 in str1?

yes.

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.