StringUtils

This static class provides additional functionality for working with strings.

Available methods

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:

resultLabel.text = localizationManager.GetLocalizedString("Fail")
    .ToColorizedString(Color.red);
Colored text as result

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.


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.

Last updated