I want to search a word inside a string :
For example let the String be "ThisIsFile.java"
and let i want to search "File.java" or "IsFile"
This is something like sql 'like' query but unfortunately i am not
getting that string from database.
Please suggest me any good solution for this. Thanks
There's a variety of ways of achieving this and the method you choose will depend on the complexity of your queries. For a simple plain symbol/word match the String class provides a contains method that takes a single parameter, the String to search for - and returns true if it occurs within the search String.
bool containsFile = myString.contains("file");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With