0
点赞
收藏
分享

微信扫一扫

使用JavaScript测试字符串中的字母是大写还是小写

zibianqu 2022-02-18 阅读 83
    // 使用JS测试字符串中的字母是大写还是小写
    let mes1 = 'a';
    let mes2 = 'A';
    if(mes1 == mes1.toLowerCase()){
        console.log('lowerCase')  //小写
    }
    if(mes1 == mes1.toUpperCase()){
        console.log('upperCase')  //大写
    }
举报

相关推荐

0 条评论