If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
counting strings on array
3 posts
• Page 1 of 1
counting strings on array
If I have a string array (with long textual strings; thus - ruby), I'd like to count - how many lines are not empty. Like this:
---------
text
text
text
text
---------
In general - there are 8 lines on that array, but not empty - only four. How to detect them? I guess it should be some simple formula for empty lines removal, and then measurement via int primitive connected to array out. Or...?
---------
text
text
text
text
---------
In general - there are 8 lines on that array, but not empty - only four. How to detect them? I guess it should be some simple formula for empty lines removal, and then measurement via int primitive connected to array out. Or...?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
Re: counting strings on array
Not a Primitive but you could do that in ruby very simple
Regards
Regards
- Attachments
-
- count array.fsm
- (462 Bytes) Downloaded 734 times
100% accuracy is the guarantee to your success. The value alters if you combine it with musical creativity.
-
chackl - Posts: 233
- Joined: Tue Aug 17, 2010 8:46 pm
- Location: Austria / Salzburg
Re: counting strings on array
Thanks.
Actually, some things I'm doing right now - require ruby instead of regular green prims, because ruby deals on the fly with arrays, while green prim based solutions are veeeery sluggish. Though - there are still things, that I prefer to rely on green wiring. I guess it's a matter of precising (in FS environment) - which things should be done with ruby, and which should not (the rest of the party can be done with it, but does not have to). And I guess for most folks there is no difference anyway.
I guess Trog is very happy, that I started to use ruby.
Actually, some things I'm doing right now - require ruby instead of regular green prims, because ruby deals on the fly with arrays, while green prim based solutions are veeeery sluggish. Though - there are still things, that I prefer to rely on green wiring. I guess it's a matter of precising (in FS environment) - which things should be done with ruby, and which should not (the rest of the party can be done with it, but does not have to). And I guess for most folks there is no difference anyway.
I guess Trog is very happy, that I started to use ruby.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 73 guests