【问题标题】:How do I extract the value of the glid parameter from this URL in ruby?如何在 ruby​​ 中从此 URL 中提取 glid 参数的值?
【发布时间】:2011-12-08 20:07:19
【问题描述】:

【问题讨论】:

标签: ruby


【解决方案1】:

您可以使用字符串拆分方法。最简单的方法。

ruby-1.9.2-p290 :004 > a = 'http://share.findmespot.com/shared/faces/viewspots.jsp?glId=0rEE45o3ERRryMevW5teqS9gkNI'
 => "http://share.findmespot.com/shared/faces/viewspots.jsp?glId=0rEE45o3ERRryMevW5teqS9gkNI" 
ruby-1.9.2-p290 :005 > b = a.split('=')[1]
 => "0rEE45o3ERRryMevW5teqS9gkNI" 

【讨论】:

    猜你喜欢
    • 2011-01-30
    • 1970-01-01
    • 1970-01-01
    • 2021-10-20
    • 2021-06-15
    • 2022-10-01
    • 1970-01-01
    • 2016-09-08
    • 1970-01-01
    相关资源
    最近更新 更多