Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 14255

A competition to solve a particular problem through the usage and manipulation of strings.

12 votes
10 answers
1k views

String of alphanumeric characters to a sorted list of comma-separated ranges

Given a string of unsorted alphanumeric characters, e.g. …
Andrew Cheong's user avatar
0 votes

String of alphanumeric characters to a sorted list of comma-separated ranges

Tcl 8.0.5, 344 (360 bytes) set a ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 set s string set x [join [lsort [split [$s toupper ABC321STPpJqZZr0] ""]] ""] regsub -all (.)\\1+ $x \\1 x set i 36 while {[incr i … rename rename & & set = & regsub R & string S & while W = a ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 = x [lsort [split [S toupper ABC321STPpJqZZr0] ""]] R -all {(.) \1+| } $x \\1 x = i 36 W {[incr i -1]} { …
Andrew Cheong's user avatar