Groovy 字符串String与GString-groovy字符串string与gstring.md
title: Groovy 字符串String与GStringdate: 2021-07-31 18:12:44.14
updated: 2021-07-31 22:17:06.049
url: /?p=402
categories: Groovy
tags:
String与GString 定义方式有三种单引号相当于java中的普通字符串 双引号可以将表达式包含在字符串中,又称可扩展字符串 三个连续的单引号 可以用原始格式输出,比如换行回车等特殊字符不需要转义。
String相关API
字符串
在Groovy种有两种字符串类型,普通字符串(java.lang.String)和插值字符串(groovy.lang.GString)。
1 | // 普通字符串使用单引号 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 LT的编程笔记!