Split String


Node Information
Splits the string into an array based on the given splitter value which can be only one character.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Text IN String ONE FALSE FALSE
Splitter IN String ONE FALSE FALSE
List OUT List<String> MULTIPLE TRUE FALSE

Source
namespace Korduene.KGraph.Nodes.String
{
    [IsNode("Split To List")]
    public class StringSplitToList : Node
    {
        Port a = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Text");
        Port splitter = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Splitter");
        Port res = new Port(PortType.OUT, typeof(List<string>), AcceptsLinks.MULTIPLE, "List");
        public StringSplitToList()
        {
            Name = "Split String";
            AddPort(a);
            AddPort(splitter);
            AddPort(res);
            res.Instructions = "init";
            Information = "Splits the string into an array based on the given splitter value which can be only one character.";
        }
        public override void UpdateResults()
        {
            res.Instructions = "(" + GetValue(a) + ").ToString().Split(new string[]{" + GetValue(splitter) + "}" + ", System.StringSplitOptions.None).ToList()";
        }
    }
}