+ 1

Can we compare character with character

using if / switch statements ex. if( char == name) where char and name are characters

16th Jul 2018, 4:44 PM
Akshay Sharma
Akshay Sharma - avatar
2 Answers
+ 1
My english is not so good you mean "character" as "letter" or "character" as type? In javascript for example (check or first letter "one" string is the same as first letter "two" string:) var one = "cat"; var two = "cow"; if(one.charAt(0) == two.charAt(0)){ alert("thesame"); } else{ alert("different"); } //result thesame
16th Jul 2018, 5:35 PM
Dawid
Dawid - avatar
+ 2
yes
16th Jul 2018, 11:06 PM
Микола Федосєєв
Микола Федосєєв - avatar