repeating string
Peter M. Brigham
pmbrig at gmail.com
Sat Feb 8 17:13:03 EST 2014
Without using Regex, you can do this:
function makeString tChar, n
-- returns a string of n characters (tChar)
-- no repeat loop!
put cr into line n of m
replace cr with tChar in m
return m
end makeString
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
On Feb 5, 2014, at 11:24 AM, Alex Tweedly 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
More information about the use-livecode
mailing list