logo
  • 教程列表
  • SO官方文檔
  • 字串和 GString 文字
    • 美元斜線字串
    • 單引號字串
    • 雙引號字串(無插值佔位符)
    • 雙引號字串(插值)
    • 多行字串
    • 多行字串(額外的尾隨換行符)
    • 多行字串(沒有額外的尾隨換行符)
    • 三重雙引號字串
    • Slashy 字串(無插值佔位符)
    • Slashy string(插值)
  1. StackOverflow 文件
  2. groovy 教程
  3. 字串和 GString 文字
  4. Slashy string(插值)

Slashy string(插值)

Created: November-22, 2018

def param = 'string'
def str = /
multiline $param
no need to escape slash
\n
/
assert str instanceof GString
assert str.readLines().size() == 4
assert str.contains('\\n')
assert str.contains('string')
  • Slashy 字串(無插值佔位符)

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明