闲云无衣
无衣的笔记
split()
trim()
indexOf()
replaceAll()
##ruby:
String.split
"hello world".split( " ")
returns [ "hello", "world" ].
String.strip
" hello world ".strip
returns "hello world".
String.index
"hello world".index( "w")
returns 6.
String.gsub(/\s/, ',')
"hello word".gsub(\/s\, ',')
returns "hello,word"
p.s.
sub() replace first
gsub() replace all
posted on 2007-02-22 15:22 无衣 阅读(1204) 评论(0)  编辑  收藏 所属分类: rails