【文件属性】:
文件名称:string-surgeon:Ruby gem 优雅地切开具有超链接的字符串
文件大小:7KB
文件格式:ZIP
更新时间:2021-07-18 09:58:02
Ruby
外科医生
Ruby gem 优雅地切开具有超链接、#hashtags 和 @mentions 的字符串
###特征:
根据给定的字符数截断字符串,其中给定的计数不包括字符串中任何链接 html 标记的字符。
获取字符串中的主题标签(如#topic)
获取字符串中的atmentions(如@name)
###职能:
truncate(n) 返回字符串的前 n 个字符,其中 n 不包括字符串中任何链接 html 标记的字符。
Example:
str = "The code can be downloaded from Github Repository."
str.truncate(45) => "The code can be downloaded from
【文件预览】:
string-surgeon-master
----spec()
--------knife_spec.rb(6KB)
--------clamp_spec.rb(1KB)
----README.md(1KB)
----License.txt(1KB)
----lib()
--------string_surgeon()
--------string_surgeon.rb(1KB)
----Gemfile(99B)
----Rakefile(161B)
----string-surgeon.gemspec(631B)