1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
2022-08-24 11:15:29 +03:00

24 lines
668 B
C#

using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Text;
[Node("String Length", "Checks whether the first input is contained in the second input.",
"Text", InputType = typeof(string), OutputType = typeof(Numeric))]
public class StringLengthNode : Node
{
public StringLengthNode()
: base("String Length", "Returns string length.")
{
Input1 = CreateInputPin<string>();
Result = CreateOutputPin<Numeric>();
}
public InputPin<string> Input1 { get; }
public OutputPin<Numeric> Result { get; }
public override void Evaluate()
{
Result.Value = new Numeric((Input1.Value ?? "").Length);
}
}