Skip to content

Instantly share code, notes, and snippets.

@nyawach
Last active November 11, 2020 08:13
Show Gist options
  • Save nyawach/522c9e9b33d8a2af9c035a0411b955a7 to your computer and use it in GitHub Desktop.
Save nyawach/522c9e9b33d8a2af9c035a0411b955a7 to your computer and use it in GitHub Desktop.
/**
* 文字列を逆にする
*
* 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