Answers for "how to chekc if char is in string"

3

how to check if a char is a letter java

Character.isDigit(string.charAt(index)) //(JavaDoc) will return true if it's a digit
Character.isLetter(string.charAt(index)) //(JavaDoc) will return true if it's a letter
Posted by: Guest on July-27-2020
0

check if character is available in string

function mutation(arr) {
 let first = arr[0].toLowerCase();
 let second = arr[1].toLowerCase();

  for(let i = 0; i < second.length; i++) {
    if(first.indexOf(second[i]) < 0) return false;
  }

  return true;
}

mutation(["hello", "hey"]);
Posted by: Guest on September-04-2021

Code answers related to "how to chekc if char is in string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language