+ 1
Can we compare character with character
using if / switch statements ex. if( char == name) where char and name are characters
2 ответов
+ 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
+ 2
yes