Pseudocode examples of usage:

"hello".capitalize()  > "Hello"  
"HELLO".capitalize()  > "Hello"  
"123ABC".capitalize()  > "123abc"  

"hello".center(4)  > "hello"  
"hello".center(20, "_")  > "_______hello________"  

"hello".chomp()  > "hello"  
"hello\n".chomp()  > "hello"  
"hello \n there".chomp()  > "hello \n there"  
"hello".chomp("llo")  > "he"

"string\r\n".chop()  > "string"  
"string\n\r".chop()  > "string\n"  
"string\n".chop()  > "string"  
"string".chop()  > "strin"  
"x".chop().chop()  > ""

a = "hello world"  
a.count("lo")  > 5  
a.count("^hello ")  > 3  
a.count("ej-m")  > 4  
a.count("^e-t")  > 3 

a = "hello"
a.ljust(4)  > "hello"  
a.ljust(20)  > "hello               "  

a = "hello world"
a.remove("l")  > "heo word"  
a.remove("lo ")  > "hewrd"  
a.remove("^aeiou")  > "eoo"  
a.remove("ej-m")  > "ho word" 
a.remove("^e-t")  > "helloorl"

"stressed".reverse()  > "desserts"  

a = "hello"
a.rjust(4)  > "hello"  
a.rjust(20, "-")  > "---------------hello"  

"yellow  moon".squeeze()  > "yelow mon"  
"  now   is  the".squeeze(" ")  > " now is the"  
"putters shoot balls".squeeze("m-z")  > "puters shot balls"  
"hello  world".squeeze("^ ")  > "helo  world"  

"    hello    ".strip()  > "hello"  
"\tgoodbye\r\n".strip()  > "goodbye"

"Hello".swapcase  > "hELLO"  
"cYbEr_PuNk11".swapcase  > "CyBeR_pUnK11"


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to