repeating string

Peter Haworth pete at lcsql.com
Wed Feb 5 19:55:25 EST 2014


This would be a useful command in LC.  I'd like to see a "strip
leading/trailing" command to.  I usually do that with a regExp but like the
solution to this problem, it's not the most readable thing in the world.

Sounds like it might be worth a post to the Open Source forum.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Wed, Feb 5, 2014 at 2:53 PM, Alex Tweedly <alex at tweedly.net> wrote:

> I absolutely agree. I have a function in my personal "standard library"
> that does (something close to) this, and I would never consider replacing
> that with this C-like code; I wrote C for a living for too many years
> already, thanks.
>
> But as an answer to the request (i.e. native LC, not a function), it's the
> best I can do :-)
>
> -- Alex.
>
> On 05/02/2014 17:51, Mike Kerner wrote:
>
>> don't get me wrong, I hate it, because it's c and I can't just stare at it
>> and know that %30s means pad the front with spaces, but nice.
>>
>>
>> On Wed, Feb 5, 2014 at 12:50 PM, Mike Kerner <MikeKerner at roadrunner.com>
>> wrote:
>>
>>  nice.
>>>
>>>
>>> On Wed, Feb 5, 2014 at 11:24 AM, Alex Tweedly <alex at tweedly.net> wrote:
>>>
>>>  On 05/02/2014 15:06, Mike Kerner wrote:
>>>>
>>>>  Alex's idea is also clever, but what if I am trying to repeat another
>>>>> character, like "#"?
>>>>>
>>>>>
>>>>>
>>>>>  put replacetext( format("%30s", " "), " ", "x") into myVar
>>>>
>>>> (no promises for being the speediest solution - but still one line and
>>>> no
>>>> library involved).
>>>> -- Alex.
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>>
>>>>
>>>
>>> --
>>> On the first day, God created the heavens and the Earth
>>> On the second day, God created the oceans.
>>> On the third day, God put the animals on hold for a few hours,
>>>     and did a little diving.
>>> And God said, "This is good."
>>>
>>>
>>
>>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list