Last active
November 11, 2020 08:13
-
-
Save nyawach/522c9e9b33d8a2af9c035a0411b955a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 文字列を逆にする | |
* | |
* ex: 'string' → gnirts | |
*/ | |
export const reverse = (target: string) => | |
target | |
.split("") | |
.reverse() | |
.join("") | |
/** | |
* 半角文字を判定する | |
*/ | |
export const isHankakuKana = (s: string) => !!s.match(/^[ヲ-゚ 0-9]*$/) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment