We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07ee470 commit 2323451Copy full SHA for 2323451
Code/MethodSystem/Methods/TextMethods/TextLengthMethod.cs
@@ -0,0 +1,23 @@
1
+using JetBrains.Annotations;
2
+using SER.Code.ArgumentSystem.Arguments;
3
+using SER.Code.ArgumentSystem.BaseArguments;
4
+using SER.Code.MethodSystem.BaseMethods.Synchronous;
5
+using SER.Code.ValueSystem;
6
+
7
+namespace SER.Code.MethodSystem.Methods.TextMethods;
8
9
+[UsedImplicitly]
10
+public class TextLengthMethod : ReturningMethod<NumberValue>
11
+{
12
+ public override string Description => "Returns the length of the text.";
13
14
+ public override Argument[] ExpectedArguments { get; } =
15
+ [
16
+ new TextArgument("text")
17
+ ];
18
19
+ public override void Execute()
20
+ {
21
+ ReturnValue = Args.GetText("text").Length;
22
+ }
23
+}
0 commit comments