Skip to content

Commit

Permalink
Added CharAt block
Browse files Browse the repository at this point in the history
Closes #685
  • Loading branch information
openbullet committed Apr 6, 2022
1 parent 37153e1 commit 69fe07f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions RuriLib/Blocks/Functions/StringFunctions/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,5 +210,14 @@ public static List<string> Split(BotData data, [Variable] string input, string s
data.Logger.Log($"Split the string into {split.Count}", LogColors.YellowGreen);
return split;
}

[Block("Gets the character at a specific index")]
public static string CharAt(BotData data, [Variable] string input, int index)
{
var character = input[index].ToString();
data.Logger.LogHeader();
data.Logger.Log($"The character at index {index} is {character}", LogColors.YellowGreen);
return character;
}
}
}

0 comments on commit 69fe07f

Please sign in to comment.