# SString

**Membres** 11

|          |                                       |                                                                               |
| -------- | ------------------------------------- | ----------------------------------------------------------------------------- |
| Fonction | [MD5](#md5)                           | Calculates the MD5Sum of input and returns the result as a hexadecimal string |
| Fonction | [SHA1](#sha1)                         | –                                                                             |
| Fonction | [Replace](#replace)                   | –                                                                             |
| Fonction | [GenerateGUID](#generateguid)         | –                                                                             |
| Fonction | [Base64Encode](#base64encode)         | Converts input to Base64 and returns the result                               |
| Fonction | [Base64Decode](#base64decode)         | Converts input from Base64 and returns the result                             |
| Fonction | [GetBytes](#getbytes)                 | Converts input to bytes using UTF8 encoding                                   |
| Fonction | [GetString](#getstring)               | Converts input to a UTF8 string                                               |
| Fonction | [EncodeURL](#encodeurl)               | –                                                                             |
| Fonction | [DecodeURL](#decodeurl)               | –                                                                             |
| Fonction | [RegexMatchResult](#regexmatchresult) | –                                                                             |

## Fonctions statiques

### MD5

static string MD5(string input)

Calculates the MD5Sum of input and returns the result as a hexadecimal string

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
md5 = Space.String.MD5('AString')

```

### SHA1

static string SHA1(string input)

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
sha1 = Space.String.SHA1('AString')

```

### Replace

static string Replace(string old, string pattern, string replace)

Paramètres

| Nom     | Type   | Valeur par défaut |
| ------- | ------ | ----------------- |
| old     | string | –                 |
| pattern | string | –                 |
| replace | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
replaced = Space.String.Replace('AString', 'APattern', 'AReplace')

```

### GenerateGUID

static string GenerateGUID()

Valeurs de retour

`string`

Exemple

**Lua**

```lua
guid = Space.String.GenerateGUID()

```

### Base64Encode

static string Base64Encode(string input)

Converts input to Base64 and returns the result

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```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

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
baseDecodedStr = Space.String.Base64Decode('aW5wdXQgdG8gZW5jb2Rl')

```

### GetBytes

static byte\[] GetBytes(string input)

Converts input to bytes using UTF8 encoding

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`byte[]`

Exemple

**Lua**

```lua
stringAsByteArray = Space.String.GetBytes('A String')

```

### GetString

static string GetString(byte\[] bytes)

Converts input to a UTF8 string

Paramètres

| Nom   | Type    | Valeur par défaut |
| ----- | ------- | ----------------- |
| bytes | byte\[] | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
ByteArrayAsString = Space.String.GetString({115, 111, 109, 101, 32})

```

### EncodeURL

static string EncodeURL(string input)

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
encodedURL = Space.String.EncodeURL('A String')

```

### DecodeURL

static string DecodeURL(string input)

Paramètres

| Nom   | Type   | Valeur par défaut |
| ----- | ------ | ----------------- |
| input | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
decodedURL = Space.String.DecodeURL('A String')

```

### RegexMatchResult

static string RegexMatchResult(string input, string pattern, string replacement)

Paramètres

| Nom         | Type   | Valeur par défaut |
| ----------- | ------ | ----------------- |
| input       | string | –                 |
| pattern     | string | –                 |
| replacement | string | –                 |

Valeurs de retour

`string`

Exemple

**Lua**

```lua
Space.Math.RegexMatchResult('astring', 'astring','astring')

```
