- liem
--
=======[rol...@cac.washington.edu]=====[The Last Gunslinger]==================
Outside of a dog, computers are a man's best | UCS Consulting
friend, inside a dog it's too dark to type. | UW Ice Hockey
http://topquark.cecer.army.mil/~roland/ | Linux/WWW/tcl/tk/LOTRmush
string length string
Returns a decimal string giving the number of characters in string.
-Sanjay Ghemawat
--
Sanjay Ghemawat
san...@lcs.mit.edu
#remove all nonletters from string
regsub {[^A-Za-z]} $string "" result
#set len to length of result
set len [string length $result]
--
-- Bill Burdick
bur...@ars.rtp.nc.us
TLG> Hwo does one count the letters in a string? For example if I wanted to
TLG> count how many letters composed the body of this article?
length of string:
string length $var
number of letters only:
regsub {[^a-zA-Z]+} $a {} b
string length $b
TLG> I can't seem to find such a function anywhere. Also, how do I count how
TLG> many lines are in a large string? (say dp_receive input from a telnet socket)
llength [split $a \n]
regsub \[^\n\] $a {} b
string length $b
--
Hume Smith 850...@dragon.acadiau.ca
"...it's the feeling so sunny when you're squeezing a bunny..."
the only Stimpy line i like: "You broke it! You broke it!"