
ruby
lzqustc
这个作者很懒,什么都没留下…
展开
-
去除html标签
方法一、 def plain_text(text,replacement=" ") text.gsub(/<[^>]*>/){|html| replacement} end str ="<p><strong><em><span style=\"text-decoration: underline;\"&g原创 2009-02-03 14:05:02 · 308 阅读 · 0 评论 -
URL Encode
在Ruby中: URI.escape == URI.encode URI.unescape ==URI.decode URI.escape (str): 采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进制数字)。比如,空格符对应的编码是%20。une...2009-07-01 17:29:30 · 183 阅读 · 0 评论