sm.util.clampUtf8String

Clamps a UTF-8 string to a maximum number of characters without splitting multi-byte sequences.

Kind: Function

Environments: Game, Terrain

Game

sm.util.clampUtf8String( string, maxLength )

Open the full Game reference

Parameters:

Name Type Description
string string The input string.
maxLength integer The maximum number of UTF-8 characters.

Returns:

Type Description
string The clamped string.

Terrain

sm.util.clampUtf8String( string, maxLength )

Open the full Terrain reference

Parameters:

Name Type Description
string string The input string.
maxLength integer The maximum number of UTF-8 characters.

Returns:

Type Description
string The clamped string.