用于字符串操作和验证的测试库。String
是Robot Framework用于操作字符串的标准库
来自BuiltIn
库的以下关键字 也可以与字符串一起使用:
- Catenate
- Get Length
- Length Should Be
- Should (Not) Be Empty
- Should (Not) Be Equal (As Strings/Integers/Numbers)
- Should (Not) Match (Regexp)
- Should (Not) Contain
- Should (Not) Start With
- Should (Not) End With
- Convert To String
- Convert To Bytes
共有30个关键字。
Convert To Lowercase Convert To Uppercase · Decode Bytes To String · Encode String To Bytes · Fetch From Left · Fetch From Right · Generate Random String · Get Line · Get Line Count ·Get Lines Containing String · Get Lines Matching Pattern · Get Lines Matching Regexp · Get Regexp Matches · Get Substring · Remove String · Remove String Using Regexp · Replace String ·Replace String Using Regexp · Should Be Byte String · Should Be Lowercase · Should Be String · Should Be Titlecase · Should Be Unicode String · Should Be Uppercase · Should Not Be String ·Split String · Split String From Right · Split String To Characters · Split To Lines · Strip String
关键字 | 参数 | 文档 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Convert To Lowercase | string | 将字符串转换为小写。 例子:
Robot Framework 2.8.6中的新功能。 |
||||||||||||
Convert To Uppercase | string | 将字符串转换为大写。 例子:
Robot Framework 2.8.6中的新功能。 |
||||||||||||
Decode Bytes To String | bytes, encoding, errors=strict |
使用给定的解码将给定
例子:
如果需要将Unicode字符串转换为字节字符串,请使用 Encode String To Bytes;如果 需要将任意对象转换为Unicode字符串,请使用 Convert To String in |
||||||||||||
Encode String To Bytes | string, encoding, errors=strict |
|