0
Compare string and char
can i compare string and char for example , string=raj; char=a; how to compare this string raj to char a ? (Not to compare character wise) i mean i don't need null at below code watch out plzzz. https://code.sololearn.com/cNWDPFfkxEg6/?ref=app
4 Respostas
+ 4
+ 2
Use a loop to iterate through each character element of the string and compare it with the character provided.
You are comparing each character from a string with another character, so you need single quotes instead of double quotes.
+ 1
but i was thinking- is it possible that ''compare with ' ???
+ 1
because if i use loop i think then also null will print i think....