generative modeling for Rhino
Hi again y'all,
It there a way of removing a number of characters from the end of a string? I have comma delimited point values in the format of "x,y,z," so I need to remove the comma from the end to make it "x,y,z" .
Bests,
Dan
Tags:
Permalink Reply by Danny Boyes on May 2, 2012 at 12:47pm there is a component for spliting a string into individual charaters. then you could shift list -1 andstring join back together again. if you need i can post a demo later

Permalink Reply by Danny Boyes on May 2, 2012 at 1:24pm thanks david, never thought about using the index cull like that
Permalink Reply by Chris Hanley on May 2, 2012 at 12:58pm using an f1 component, you could use the formula
Left(x,5)
x being your list of values in x,y,z, format.
Permalink Reply by Danny Boyes on May 2, 2012 at 1:27pm ideally it should include the string length function -1.
cannot remember if is left(x,length(x)-1) or left(x,len(x)-1)
Permalink Reply by Chris Hanley on May 2, 2012 at 1:51pm I do like the cull index example!
Permalink Reply by Daniel Bates on May 2, 2012 at 2:09pm Just want to say, loving the level of response on this forum. I hope to contribute something back one day!
I've tried both methods, the cull method seems faster computationally, which may be handy to know!
Thanks!

Note that the first time a component runs it will take a long time to complete because it must be compiled first. Try hitting F5 and then look at the real performance.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Permalink Reply by Daniel Bates on May 3, 2012 at 4:23am I refreshed several times, on average the function method was slower.
Not much of a big deal unless you had several several tens of thousands of points though really.
Added by Mgeorgio 0 Comments 0 Likes
Added by Mgeorgio 0 Comments 0 Likes
© 2013 Created by Scott Davidson.
Powered by