Class StringExtensions
This class contains extension methods for the string class.
Inherited Members
Namespace: UnityEngine.TestTools.Graphics
Assembly: UnityEngine.TestTools.Graphics.dll
Syntax
public static class StringExtensions
Methods
FromUrlSafeBase64(string)
Converts a URL-safe Base64 string to a regular Base64 string.
Declaration
public static string FromUrlSafeBase64(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The URL-safe Base64 string to convert to a regular Base64 string. |
Returns
| Type | Description |
|---|---|
| string | The regular Base64 string. |
SanitizeBackslashes(string)
Replaces backslashes with forward slashes in the given string
Declaration
public static string SanitizeBackslashes(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The string to sanitize |
Returns
| Type | Description |
|---|---|
| string | The string with backslashes replaced with forward slashes |
ToUrlSafeBase64(string)
Converts a string to a URL-safe Base64 string.
Declaration
public static string ToUrlSafeBase64(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The string to convert to a URL-safe Base64 string. |
Returns
| Type | Description |
|---|---|
| string | The URL-safe Base64 string. |
ToValidPath(string)
Replaces invalid characters in a string to make it a valid path.
Declaration
public static string ToValidPath(this string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The string to make a valid path. |
Returns
| Type | Description |
|---|---|
| string | A valid path string. |
Remarks
Replacement rules are intentionally asymmetric to produce readable, filesystem-safe paths:
(is replaced with_(preserves word boundary))is removed entirely (closing paren adds no value)"is removed entirely,is replaced with-(preserves visual separator)