# StringUtils

This static class provides additional functionality for working with strings.

### Available methods

```csharp
public static string ToColorizedString(this string str, Color color)
```

This extension method colours given string by **color**. *But be aware that such string will be displayed correctly only on Rich Text components.*

*Example:*

```csharp
resultLabel.text = localizationManager.GetLocalizedString("Fail")
    .ToColorizedString(Color.red);
```

<figure><img src="https://1131436974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9rEHd0nHFvWCSkMEfAjl%2Fuploads%2Fk6vnXUGhXwOrVe6VkZTI%2Fimage.png?alt=media&#x26;token=98cfef58-d1a6-47eb-a9f2-701ae06904f9" alt=""><figcaption><p>Colored text as result</p></figcaption></figure>

***

```csharp
public static string ToBoldString(this string str)
```

*This extension method makes given string bold. But be aware that such string will be displayed correctly only on Rich Text components.*

***

```csharp
public static string ToItalicString(this string str)
```

*This extension method makes given string italic. But be aware that such string will be displayed correctly only on Rich Text components.*
