Skip to content

Commit 2323451

Browse files
Create TextLengthMethod.cs
1 parent 07ee470 commit 2323451

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)