SString
客户端类型
成员 11
| 函数 | MD5 | Calculates the MD5Sum of input and returns the result as a hexadecimal string |
| 函数 | SHA1 | – |
| 函数 | Replace | – |
| 函数 | GenerateGUID | – |
| 函数 | Base64Encode | Converts input to Base64 and returns the result |
| 函数 | Base64Decode | Converts input from Base64 and returns the result |
| 函数 | GetBytes | Converts input to bytes using UTF8 encoding |
| 函数 | GetString | Converts input to a UTF8 string |
| 函数 | EncodeURL | – |
| 函数 | DecodeURL | – |
| 函数 | RegexMatchResult | – |
静态函数
MD5
static string MD5(string input)
Calculates the MD5Sum of input and returns the result as a hexadecimal string
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
string
示例
Lua
md5 = Space.String.MD5('AString')
SHA1
static string SHA1(string input)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
string
示例
Lua
sha1 = Space.String.SHA1('AString')
Replace
static string Replace(string old, string pattern, string replace)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| old | string | – |
| pattern | string | – |
| replace | string | – |
返回值
string
示例
Lua
replaced = Space.String.Replace('AString', 'APattern', 'AReplace')
GenerateGUID
static string GenerateGUID()
返回值
string
示例
Lua
guid = Space.String.GenerateGUID()
Base64Encode
static string Base64Encode(string input)
Converts input to Base64 and returns the result
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
string
示例
Lua
baseEncodeByte = Space.String.Base64Encode{117, 116, 32, 116, 100, 101})
Base64Decode
static string Base64Decode(string input)
Converts input from Base64 and returns the result
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
string
示例
Lua
baseDecodedStr = Space.String.Base64Decode('aW5wdXQgdG8gZW5jb2Rl')
GetBytes
static byte[] GetBytes(string input)
Converts input to bytes using UTF8 encoding
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
byte[]
示例
Lua
stringAsByteArray = Space.String.GetBytes('A String')
GetString
static string GetString(byte[] bytes)
Converts input to a UTF8 string
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| bytes | byte[] | – |
返回值
string
示例
Lua
ByteArrayAsString = Space.String.GetString({115, 111, 109, 101, 32})
EncodeURL
static string EncodeURL(string input)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
string
示例
Lua
encodedURL = Space.String.EncodeURL('A String')
DecodeURL
static string DecodeURL(string input)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
返回值
string
示例
Lua
decodedURL = Space.String.DecodeURL('A String')
RegexMatchResult
static string RegexMatchResult(string input, string pattern, string replacement)
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| input | string | – |
| pattern | string | – |
| replacement | string | – |
返回值
string
示例
Lua
Space.Math.RegexMatchResult('astring', 'astring','astring')



