String Contains


Node Information
Checks string, if string contains specified value TRUE will be returned, else FALSE will be returned.
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
Value IN String ONE FALSE FALSE
Result OUT Boolean MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.String
{
    [IsNode("Contains")]
    public class StringContains : Node
    {
        Port str = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Text");
        Port val = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Value");
        Port res = new Port(PortType.OUT, typeof(bool), AcceptsLinks.MULTIPLE, "Result");
        public string Value
        {
            set { val.Value = value; }
            get { return GetRuntimeValue(val); }
        }
        public StringContains()
        {
            this.NodeType = KGraph.NodeType.Function;
            this.ReturnType = typeof(bool);
            this.Name = "String Contains";
            AddPort(str);
            AddPort(val);
            AddPort(res);
            Information = "Checks string, if string contains specified value TRUE will be returned, else FALSE will be returned.";
        }
        public override string Code()
        {
            return "return " + GetValue(str) + ".ToString().Contains(" + GetValue(val) + ");";
        }
    }
}