home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 mARCH
/
PCWK3A99.iso
/
Linux
/
DDD331
/
DDD-3_1_.000
/
DDD-3_1_
/
ddd-3.1.1
/
ddd
/
tString.exp
< prev
next >
Wrap
Text File
|
1996-04-15
|
1KB
|
51 lines
an empty string:
A string initialized to Hello:Hello
A string initialized to previous string:Hello
A string initialized to previous string.at(1, 2):el
A string initialized to @:@
A string initialized to dec(20):20
n = 20 atoi(n) = 20 atof(n) = 20
z = x + y = Helloworld
x += y; x = Helloworld
y.prepend(x); y = Helloworld
cat(x, y, x, x); x = HelloworldHello
cat(y, x, x, x); x = worldHelloHello
z = x + s + + y.at(w) + y.after(w) + . = Hello, world.
ch = x[0] = H
z = x.at(2, 3) = llo
x.at(2, 2) = r; x = Hero
x.at(0, 1) = j; x = jello
x.at(He) = je; x = jello
x.at(l, -1) = i; x = Helio
z = x.at(r) = ello
z = x.before(o) = Hell
x.before(ll) = Bri; x = Brillo
z = x.before(2) = He
z = x.after(Hel) = lo
x.after(Hel) = p; x = Help
z = x.after(3) = o
z = a bc; z = z.after(rxwhite); z =a bc
x.gsub(l, ll); x = Hellllo
x.gsub(r, ...); x = Hello should have been replaced by this string
x.gsub(rxwhite, #); x = Hello#should#have#been#replaced#by#this#string
z = x+y; z.del(loworl); z = Held
reverse(x) = olleH
x.reverse() = olleH
upcase(x) = HELLO
downcase(x) = hello
capitalize(x) = Hello
capitalize(z) = He Asked:'This Is Nathan'S Book?'. 'No, It'S Not',I Said.
z = replicate(*, 10) = **********
z = This string has
five words
from split(z, rxwhite, w, 10), n words = 5:
This
string
has
five
words
z = join(w, nw, /); z =This/string/has/five/words
enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
End of test