Namespace

CType

CType

Provides a set of static routines that return information about characters. These routines emulate the C-library ctype functions. The characters must be encoded in utf-16, as no other charsets are currently supported. Only the first character of the given string is tested.

View Source CType.js, line 34

Methods

# protected static withinRange(ch, rangeName) → {boolean}

Return whether or not the first character is within the named range of Unicode characters. The valid list of range names are taken from the Unicode 6.0 spec. Characters in all ranges of Unicode are supported, including those supported in Javascript via UTF-16. Currently, this method supports the following range names:

  • ascii - basic ASCII
  • latin - Latin, Latin Extended Additional, Latin-1 supplement, Latin Extended-C, Latin Extended-D, Latin Extended-E
  • armenian
  • greek - Greek, Greek Extended
  • cyrillic - Cyrillic, Cyrillic Extended-A, Cyrillic Extended-B, Cyrillic Extended-C, Cyrillic Supplement
  • georgian - Georgian, Georgian Supplement
  • glagolitic - Glagolitic, Glagolitic Supplement
  • gothic
  • ogham
  • oldpersian
  • runic
  • ipa - IPA, Phonetic Extensions, Phonetic Extensions Supplement
  • phonetic
  • modifiertone - Modifier Tone Letters
  • spacing
  • diacritics
  • halfmarks - Combining Half Marks
  • small - Small Form Variants
  • bamum - Bamum, Bamum Supplement
  • ethiopic - Ethiopic, Ethiopic Extended, Ethiopic Extended-A
  • nko
  • osmanya
  • tifinagh
  • val
  • arabic - Arabic, Arabic Supplement, Arabic Presentation Forms-A, Arabic Presentation Forms-B, Arabic Mathematical Alphabetic Symbols
  • carlan
  • hebrew
  • mandaic
  • samaritan
  • syriac
  • mongolian
  • phagspa
  • tibetan
  • bengali
  • devanagari - Devanagari, Devanagari Extended
  • gujarati
  • gurmukhi
  • kannada
  • lepcha
  • limbu
  • malayalam
  • meetaimayek
  • olchiki
  • oriya
  • saurashtra
  • sinhala
  • sylotinagri - Syloti Nagri
  • tangut
  • tamil
  • telugu
  • thaana
  • vedic
  • batak
  • balinese
  • buginese
  • cham
  • javanese
  • kayahli
  • khmer
  • lao
  • myanmar - Myanmar, Myanmar Extended-A, Myanmar Extended-B
  • newtailue
  • rejang
  • sundanese - Sundanese, Sundanese Supplement
  • taile
  • taitham
  • taiviet
  • thai
  • buhld
  • hanunoo
  • tagalog
  • tagbanwa
  • bopomofo - Bopomofo, Bopomofo Extended
  • cjk - the CJK unified ideographs (Han), CJK Unified Ideographs Extension A, CJK Unified Ideographs Extension B, CJK Unified Ideographs Extension C, CJK Unified Ideographs Extension D, Ideographic Description Characters (=isIdeo())
  • cjkcompatibility - CJK Compatibility, CJK Compatibility Ideographs, CJK Compatibility Forms, CJK Compatibility Ideographs Supplement
  • cjkradicals - the CJK radicals, KangXi radicals
  • hangul - Hangul Jamo, Hangul Syllables, Hangul Jamo Extended-A, Hangul Jamo Extended-B, Hangul Compatibility Jamo
  • cjkpunct - CJK symbols and punctuation
  • cjkstrokes - CJK strokes
  • hiragana
  • katakana - Katakana, Katakana Phonetic Extensions, Kana Supplement
  • kanbun
  • lisu
  • yi - Yi Syllables, Yi Radicals
  • cherokee
  • canadian - Unified Canadian Aboriginal Syllabics, Unified Canadian Aboriginal Syllabics Extended
  • presentation - Alphabetic presentation forms
  • vertical - Vertical Forms
  • width - Halfwidth and Fullwidth Forms
  • punctuation - General punctuation, Supplemental Punctuation
  • box - Box Drawing
  • block - Block Elements
  • letterlike - Letterlike symbols
  • mathematical - Mathematical alphanumeric symbols, Miscellaneous Mathematical Symbols-A, Miscellaneous Mathematical Symbols-B
  • enclosedalpha - Enclosed alphanumerics, Enclosed Alphanumeric Supplement
  • enclosedcjk - Enclosed CJK letters and months, Enclosed Ideographic Supplement
  • cjkcompatibility - CJK compatibility
  • apl - APL symbols
  • controlpictures - Control pictures
  • misc - Miscellaneous technical
  • ocr - Optical character recognition (OCR)
  • combining - Combining Diacritical Marks, Combining Diacritical Marks for Symbols, Combining Diacritical Marks Supplement, Combining Diacritical Marks Extended
  • digits - ASCII digits (=isDigit())
  • indicnumber - Common Indic Number Forms
  • numbers - Number forms
  • supersub - Superscripts and Subscripts
  • arrows - Arrows, Miscellaneous Symbols and Arrows, Supplemental Arrows-A, Supplemental Arrows-B, Supplemental Arrows-C
  • operators - Mathematical operators, supplemental mathematical operators
  • geometric - Geometric shapes, Geometric shapes extended
  • ancient - Ancient symbols
  • braille - Braille patterns
  • currency - Currency symbols
  • dingbats
  • gamesymbols
  • yijing - Yijing Hexagram Symbols
  • specials
  • variations - Variation Selectors, Variation Selectors Supplement
  • privateuse - Private Use Area, Supplementary Private Use Area-A, Supplementary Private Use Area-B
  • supplementarya - Supplementary private use area-A
  • supplementaryb - Supplementary private use area-B
  • highsurrogates - High Surrogates, High Private Use Surrogates
  • lowsurrogates
  • reserved
  • noncharacters
  • copticnumber - coptic epact numbers
  • oldpermic - old permic
  • albanian - albanian
  • lineara - linear a
  • meroitic - meroitic cursive
  • oldnortharabian - old north arabian
  • oldhungarian - Supplementary private use area-A
  • sorasompeng - sora sompeng
  • warangciti - warang citi
  • paucinhau - pau cin hau
  • bassavah - bassa vah
  • pahawhhmong - pahawh hmong
  • shorthandformat - shorthand format controls
  • suttonsignwriting - sutton signwriting
  • pictographs - miscellaneous symbols and pictographs, supplemental symbols and pictographs
  • ornamentaldingbats - ornamental dingbats

Parameters:
Name Type Description
ch string | IString | number

character or code point to examine

rangeName string

the name of the range to check

View Source CType.js, line 274

true if the first character is within the named range

boolean