AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

FastString.Clear

Method

public FastString Clear()

Parameters

No parameters.

Returns

FastString

The same instance of FastString

Description

Clears the contents of the string. This effectively sets the string FastString.Length back to zero.

The FastString.Clear method returns this, which allows it to be chained with other methods such as FastString.Append.

Example

// Allocate a FastString that can hold up to 256 characters
FastString fstr = new FastString(256);

void Render() {
    fstr.Set("Hello there ").Append(playerName).Append("!");
    RB.Print(new Vector2i(00), Color.white, fstr);
}

See Also

FastString.Append
FastString.Truncate

See Docs

Features - Avoid GC with Fast String