-
-
Notifications
You must be signed in to change notification settings - Fork 976
New node: String Split #3304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New node: String Split #3304
Conversation
|
Sorry that I didn't see this pr earlier, feel free to just request a review from me in the future. I made a few changes to your pr let me know if you disagree with any of these |
|
I agree with changes! |
node-graph/gcore/src/logic.rs
Outdated
|
|
||
| // Get an indexed part of string whitch separated a specified delimeter ("1;2;3" e.t.c.) | ||
| #[node_macro::node(category("Text"))] | ||
| fn substring_by_index(_: impl Ctx, string: String, #[default("\\n")] delimeter: String, index: u32) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this node name should include split since we split by the substring and don't index by it. @Keavon opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We split the string and take the value by index, perhaps for optimization it is better if it is 2 nodes.
|
I suggest we allow |
The main goal was to process strings as arrays or other structures (in the case of JSON, but the code for it is not posted, there the path to the data is used to extract the string or number), if it is possible to use node polymorphism, for example, counting elements or calculating the size of a string vector, with existing nodes (Count Elements e.t.c.), this will be cool and intuitive. |
|
Yes, their monomorphized forms just have to be added to the |
|
!build |
|
c1845d7 to
ab969ee
Compare

Features for text:
split node that allows splits a String Value and returns a Vec of strings: