【Lintcode】23. Is alphanumeric
作者:互联网
题目地址:
https://www.lintcode.com/problem/is-alphanumeric/description
判断一个字符是否是数字或者字母。
代码如下:
public class Solution {
/**
* @param c: A character.
* @return: The character is alphanumeric or not.
*/
public boolean isAlphanumeric(char c) {
// write your code here
return Character.isDigit(c) || Character.isLetter(c);
}
}
时空复杂度 O ( 1 ) O(1) O(1)。
标签:isLetter,return,23,character,Lintcode,Character,alphanumeric,public 来源: https://blog.csdn.net/qq_46105170/article/details/113430461