varMessage =
"hi/thsid/sdfhsjdf/dfjsd/sdjfsdn\n"
"/my/name/is/balaji.so\n"
"call::myFunction(int const&)\n"
"void::secondFunction(char const&)\n"
.
.
.
"this/is/last/line/liobrary.so"
How do I create a method that finds out if a string like "hi" or "this/is" is included when I have this string?
ruby string
#include? method.
Returns true if str contains the given string or character.
If str
contains other_str
, return true
my_string = "abcdefg"
if my_string.include? "cde"
puts "String includes 'cde'"
end
© 2024 OneMinuteCode. All rights reserved.