Skip to content

CharacterRange ​

Every character from c1 to c2, inclusive, in Unicode code-point order.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageCharacterRange✓
CharacterRange(c1, c2)the characters from c1 to c2, inclusive
CharacterRange(n1, n2)the same range, given as code points directly
Typed signatures
TypePackageApplies
(integer | string, integer | string) -> list<string>combinatoricsalways

Domain: Collections

Details
  • Counts code points, the same convention ToCharacterCode/StringLength/FromCharacterCode (expression-ops.ts) already use — an astral character is one code point, not two UTF-16 units.

Examples

Basic #
live ↗
InCharacterRange(a,e)\mathrm{CharacterRange}(\text{a}, \text{e})Out[a,b,c,d,e]\bigl\lbrack\text{a}, \text{b}, \text{c}, \text{d}, \text{e}\bigr\rbrack

The lowercase alphabet by code point

live ↗
InCharacterRange(a,z)\mathrm{CharacterRange}(\text{a}, \text{z})Out[a,b,c,d,e,f,"g","h",i,j,k,l,"m",n,o,p,q,r,"s","t",u,v,w,x,y,z]\bigl\lbrack\text{a}, \text{b}, \text{c}, \text{d}, \text{e}, \text{f}, "g", "h", \text{i}, \text{j}, \text{k}, \text{l}, "m", \text{n}, \text{o}, \text{p}, \text{q}, \text{r}, "s", "t", \text{u}, \text{v}, \text{w}, \text{x}, \text{y}, \text{z}\bigr\rbrack
live ↗
InCharacterRange(1 000,1 020)\mathrm{CharacterRange}(1\,000, 1\,020)Out[Ϩ,ϩ,Ϫ,ϫ,Ϭ,ϭ,Ϯ,ϯ,ϰ,ϱ,ϲ,ϳ,ϴ,ϵ,϶,Ϸ,ϸ,Ϲ,Ϻ,ϻ,ϼ]\bigl\lbrack\text{Ϩ}, \text{ϩ}, \text{Ϫ}, \text{ϫ}, \text{Ϭ}, \text{ϭ}, \text{Ϯ}, \text{ϯ}, \text{ϰ}, \text{$\varrho$}, \text{ϲ}, \text{ϳ}, \text{ϴ}, \text{$\epsilon$}, \text{϶}, \text{Ϸ}, \text{ϸ}, \text{Ϲ}, \text{Ϻ}, \text{ϻ}, \text{ϼ}\bigr\rbrack
Scope #
live ↗
InCharacterRange(97,101)\mathrm{CharacterRange}(97, 101)Out[a,b,c,d,e]\bigl\lbrack\text{a}, \text{b}, \text{c}, \text{d}, \text{e}\bigr\rbrack

Uppercase runs the same way

live ↗
InCharacterRange("A",Z)\mathrm{CharacterRange}("A", \text{Z})Out["A",B,"C",D,E,"F",G,"H",I,"J","K","L",M,"N",O,P,Q,R,"S","T",U,"V","W",X,Y,Z]\bigl\lbrack"A", \text{B}, "C", \text{D}, \text{E}, "F", \text{G}, "H", \text{I}, "J", "K", "L", \text{M}, "N", \text{O}, \text{P}, \text{Q}, \text{R}, "S", "T", \text{U}, "V", "W", \text{X}, \text{Y}, \text{Z}\bigr\rbrack

The digit characters

live ↗
InCharacterRange(0,9)\mathrm{CharacterRange}(\text{0}, \text{9})Out[0,1,2,3,4,5,6,7,8,9]\bigl\lbrack\text{0}, \text{1}, \text{2}, \text{3}, \text{4}, \text{5}, \text{6}, \text{7}, \text{8}, \text{9}\bigr\rbrack

Printable ASCII from space to tilde

live ↗
InCharacterRange( ,~)\mathrm{CharacterRange}(\text{ }, \text{\textasciitilde{}})Out[ ,!,",#,$,%,&,’,(,),"∗",+,,,-,.,/,0,1,2,3,4,5,6,7,8,9,:,;,<,=,>,?,@,"A",B,"C",D,E,"F",G,"H",I,"J","K","L",M,"N",O,P,Q,R,"S","T",U,"V","W",X,Y,Z,[,\,],^,_,‘,a,b,c,d,e,f,"g","h",i,j,k,l,"m",n,o,p,q,r,"s","t",u,v,w,x,y,z,{,|,},~]\bigl\lbrack\text{ }, \text{!}, \text{"}, \text{\#}, \text{\$}, \text{\%}, \text{\&}, \text{'}, \text{(}, \text{)}, "*", \text{+}, \text{,}, \text{-}, \text{.}, \text{/}, \text{0}, \text{1}, \text{2}, \text{3}, \text{4}, \text{5}, \text{6}, \text{7}, \text{8}, \text{9}, \text{:}, \text{;}, \text{<}, \text{=}, \text{>}, \text{?}, \text{@}, "A", \text{B}, "C", \text{D}, \text{E}, "F", \text{G}, "H", \text{I}, "J", "K", "L", \text{M}, "N", \text{O}, \text{P}, \text{Q}, \text{R}, "S", "T", \text{U}, "V", "W", \text{X}, \text{Y}, \text{Z}, \text{[}, \text{\textbackslash{}}, \text{]}, \text{\textasciicircum{}}, \text{\_}, \text{`}, \text{a}, \text{b}, \text{c}, \text{d}, \text{e}, \text{f}, "g", "h", \text{i}, \text{j}, \text{k}, \text{l}, "m", \text{n}, \text{o}, \text{p}, \text{q}, \text{r}, "s", "t", \text{u}, \text{v}, \text{w}, \text{x}, \text{y}, \text{z}, \text{\{}, \text{|}, \text{\}}, \text{\textasciitilde{}}\bigr\rbrack
About
Examples7
Checked againstWolfram Language 7 agree
CrosswalkWolfram Language

See also: ToCharacterCode, FromCharacterCode