日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產(chǎn)品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
迅速掌握Ruby轉義字符

Ruby轉義字符對于一個初學Ruby語言來說是一個比較陌生的用法。在下面這篇文章中我們將會學到一些關于Ruby轉義字符的相關用法。#t#

Ruby轉義字符代碼示例:

  1. #! /usr/local/bin/ruby
  2. # Author: xlzhu
  3. # date: 2009-12-08
  4. # Summary: encode string.
  5. class IEncoder
  6. def initialize
  7. end
  8. # Execute the given file using 
    the associate app
  9. def run(orgStr)
  10. str = orgStr
  11. strstr = str.gsub('<', '<')
  12. strstr = str.gsub('>', '>')
  13. strstr = str.gsub(/['"]/, '"')
  14. strstr = str.lstrip #去掉前后空格
  15. strstr = str.delete("\n\r") #去掉換行符
  16. strstr = str.delete(" ")#去掉tab
  17. puts str
  18. end
  19. end

iencoder = IEncoder.new
txt = IO.read("renderers.xml")
puts txt
iencoder.run(txt)

以上就是Ruby轉義字符的相關使用方法介紹。


網(wǎng)頁名稱:迅速掌握Ruby轉義字符
瀏覽地址:http://m.5511xx.com/article/dhpojoe.html