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

FastString.StartsWith

Method

public bool StartsWith(string str)
public bool StartsWith(FastString str)

Parameters

str string String to look for

Returns

bool

True if starts with given string

Description

Returns true if string starts with the given string.

Example

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

void Update() {
    fstr.Set("RetroBlit");
    Debug.Log(fstr.StartsWith("Retro")); // true
    Debug.Log(fstr.StartsWith("Blit")); // false

    fstr.Set("  RetroBlit");
    Debug.Log(fstr.StartsWith("Retro")); // false
}

See Also

FastString.EndsWith