티스토리 뷰

728x90

let inputValue = "A"

 

print("\u{30}") // result : 0

print("\u{39}") // result : 9

print("\u{41}") // result : A

print("\u{5a}") // result : Z

print("\u{61}") // result : a

print("\u{7a}") // result : z

 

// check positive number

if inputValue >= "\u{30}" && inputValue <= "\u{39}" {

    print("positive number")

} else {

    print("in not positive number")

}

 

// check upper case

if inputValue >= "\u{41}" && inputValue <= "\u{5a}" {

    print("upper case")

} else {

    print("is not upper case")

}

 

// check lower case

if inputValue >= "\u{61}" && inputValue <= "\u{7a}" {

    print("lower case")

} else {

    print("is not lower case")

}

728x90

'ios' 카테고리의 다른 글

function  (0) 2022.05.23
closure  (0) 2022.05.23
if let  (0) 2022.05.21
print  (0) 2022.05.21
for  (0) 2022.05.20
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함