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

FastString.Replace

Method

public FastString Replace(string oldStr, string newStr)
public FastString Replace(FastString oldStr, FastString newStr)
public FastString Replace(string oldStr, FastString newStr)
public FastString Replace(FastString oldStr, string newStr)
public FastString Replace(char oldChar, char newChar)

Parameters

oldStr string Old string
newStr string New string
oldChar char Old character
newChar char New character

Returns

FastString

The same instance of FastString

Description

Replace all instances of the given string with a new string.

Example

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

void Update() {
    fstr.Set("{name} gains experience! {name} levels up!");
    Debug.Log(fstr.Replace("{name}""Pete")); // fstr == "Pete gains experience! Pete levels up!"
}

See Also

FastString.Remove
FastString.Substring