SpiderFlow-string

时间:2026-02-15

string

string

substring

参数名描述可否为空
content被截取的内容否
beginIndex起始位置否
endIndex结束位置是

TIP

返回值类型:String

截取字符串

  • 从unhappy中提取happy

${string.substring('unhappy',2)}
  • 从smiles中提取mile

${string.substring('smiles',1,5)}

lower

参数名描述可否为空
content要转小写的字符串否

TIP

返回值类型:String

字符串转小写

  • 把hello变成小写hello

${string.lower('HELLO')}

upper

参数名描述可否为空
content要转大写的字符串否

TIP

返回值类型:String

字符串转大写

  • 把hello变成大写HELLO

${string.upper('hello')}

indexOf

参数名描述可否为空
content被查找的字符串否
str要查找的字符串否
fromIndex起始位置是

TIP

返回值类型:int

获取字符串在被查找字符串中的位置

  • 找world在hello world中的位置

${string.indexOf('hello world','world')}

replace

参数名描述可否为空
content被替换的字符串否
source要替换的字符串否
target目标字符串否

TIP

返回值类型:String

替换字符串

  • 把Hello,World!替换成Hello,SpiderFlow!

${string.replace('Hello,World','World','SpiderFlow')}

replaceAll

参数名描述可否为空
content被替换的字符串否
regx正则表达式否
target替换字符串否

TIP

返回值类型:String

正则替换字符串

  • 把h1e2l3l4o5替换成hello

${string.replaceAll('h1e2l3l4o5','\\d+','')}

replaceFirst

参数名描述可否为空
content被替换的字符串否
regx正则表达式否
target替换字符串否

TIP

返回值类型:String

正则替换第一个字符串

  • 把h1e2l3l4o5替换成he2l3l4o5

${string.replaceFirst('h1e2l3l4o5','\\d+','')}

length

参数名描述可否为空
content要获取长度的字符串否

TIP

返回值类型:int

获取字符串的长度

  • 获取hello的长度

${string.length('hello')}

trim

参数名描述可否为空
content要去除前后空格的字符串否

TIP

返回值类型:String

去除前后空格

split

参数名描述可否为空
content被替换的字符串否
regx正则表达式否

TIP

返回值类型:String

正则分割字符串

  • 把h1e2l3l4o5替换成['h','e','l','l','o']

${string.split('h1e2l3l4o5','\\d+')}

bytes

参数名描述可否为空
content被替换的字符串否
charset编码格式是

TIP

返回值类型:byte[]

获取字符串的字节数组

  • 获取字符串hello的字节数组

${string.bytes('hello')}

newString

参数名描述可否为空
byte[]字节数组否
charset编码格式否

TIP

返回值类型:String

  • 把字节数组转为String

${string.newString(resp.bytes)}

equals

参数名描述可否为空
str1字符串1否
str2字符串2否

TIP

返回值类型:String

  • 判断两个字符串是否相同

${string.equals(resp.html,'hello,world')}

uuid

TIP

返回值类型:String

  • 获取一个UUID字符串

${string.uuid()}

uuids

参数名描述可否为空
size要获取uuid的数量否

TIP

返回值类型:List<String>

  • 获取10个uuid

${string.uuids(10)}


免责声明:服务用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯本网站及相关权利人的合法权利。
IPv4 © 2005-2026 库目书 版权所有 | kumushu.com .All Rights Reserved
黑ICP备2022003236号-1