mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
omit "string" from descriptions
This commit is contained in:
parent
37f544a9c1
commit
2e5977b55f
@ -2,12 +2,12 @@
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Text;
|
||||
|
||||
[Node("String Length", "Checks whether the first input is contained in the second input.",
|
||||
[Node("Text Length", "Outputs the length of the input text.",
|
||||
"Text", InputType = typeof(string), OutputType = typeof(Numeric))]
|
||||
public class StringLengthNode : Node
|
||||
{
|
||||
public StringLengthNode()
|
||||
: base("String Length", "Returns string length.")
|
||||
: base("Text Length", "Outputs text length.")
|
||||
{
|
||||
Input1 = CreateInputPin<string>();
|
||||
Result = CreateOutputPin<Numeric>();
|
||||
@ -19,6 +19,6 @@ public class StringLengthNode : Node
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
Result.Value = new Numeric((Input1.Value ?? "").Length);
|
||||
Result.Value = Input1.Value == null ? new Numeric(0) : new Numeric(Input1.Value.Length);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Text;
|
||||
|
||||
[Node("Text is empty", "Outputs true if the input text is empty, false if it contains any text.",
|
||||
"Text", InputType = typeof(string), OutputType = typeof(bool))]
|
||||
public class StringNullOrEmptyNode : Node
|
||||
{
|
||||
public StringNullOrEmptyNode()
|
||||
: base("Text is empty", "Outputs true if empty")
|
||||
{
|
||||
Input1 = CreateInputPin<string>();
|
||||
Output1 = CreateOutputPin<bool>("true");
|
||||
}
|
||||
|
||||
public InputPin<string> Input1 { get; }
|
||||
|
||||
public OutputPin<bool> Output1 { get; }
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
bool isNullOrWhiteSpace = string.IsNullOrWhiteSpace(Input1.Value);
|
||||
Output1.Value = isNullOrWhiteSpace;
|
||||
}
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
using Artemis.Core;
|
||||
|
||||
namespace Artemis.VisualScripting.Nodes.Text;
|
||||
|
||||
[Node("String Null or WhiteSpace", "Checks whether the string is null, empty or white space.",
|
||||
"Text", InputType = typeof(string), OutputType = typeof(bool))]
|
||||
public class StringNullOrWhiteSpaceNode : Node
|
||||
{
|
||||
public StringNullOrWhiteSpaceNode()
|
||||
: base("Null or White Space", "Returns true if null or white space")
|
||||
{
|
||||
Input1 = CreateInputPin<string>();
|
||||
NullOrWhiteSpaceResult = CreateOutputPin<bool>("true");
|
||||
HasContentResult = CreateOutputPin<bool>("false");
|
||||
}
|
||||
|
||||
public InputPin<string> Input1 { get; }
|
||||
|
||||
public OutputPin<bool> NullOrWhiteSpaceResult { get; }
|
||||
|
||||
public OutputPin<bool> HasContentResult { get; }
|
||||
|
||||
public override void Evaluate()
|
||||
{
|
||||
bool isNullOrWhiteSpace = string.IsNullOrWhiteSpace(Input1.Value);
|
||||
NullOrWhiteSpaceResult.Value = isNullOrWhiteSpace;
|
||||
HasContentResult.Value = !isNullOrWhiteSpace;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user