Skip to content

Commit 6a1d1dd

Browse files
Create TrimTextMethod.cs
1 parent 2323451 commit 6a1d1dd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using JetBrains.Annotations;
2+
using SER.Code.ArgumentSystem.Arguments;
3+
using SER.Code.ArgumentSystem.BaseArguments;
4+
using SER.Code.Helpers.Extensions;
5+
using SER.Code.MethodSystem.BaseMethods.Synchronous;
6+
using SER.Code.ValueSystem;
7+
8+
namespace SER.Code.MethodSystem.Methods.TextMethods;
9+
10+
[UsedImplicitly]
11+
public class TrimTextMethod : ReturningMethod<TextValue>
12+
{
13+
public override string Description => "Trims the text value from whitspaces at the beginning and end.";
14+
15+
public override Argument[] ExpectedArguments { get; } =
16+
[
17+
new TextArgument("text")
18+
];
19+
20+
public override void Execute()
21+
{
22+
ReturnValue = Args
23+
.GetText("text")
24+
.Trim()
25+
.ToDynamicTextValue(Script);
26+
}
27+
}

0 commit comments

Comments
 (0)