armory/Sources/armory/logicnode/SubStringNode.hx

18 lines
406 B
Haxe
Raw Normal View History

2019-09-29 20:52:00 +02:00
package armory.logicnode;
class SubStringNode extends LogicNode {
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2019-09-29 20:52:00 +02:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function get(from: Int): Dynamic {
var string: String = inputs[0].get();
var start: Int = inputs[1].get();
var end: Int = inputs[2].get();
2019-09-29 20:52:00 +02:00
if (start == null || end == null || string == null) return null;
return string.substring(start, end);
}
}