From: Benoit Daloze Date: 2010-06-03T05:50:03+09:00 Subject: Re: PRE DETERMINE THE SIZE OF A STRING --0016e6546f1e5427f50488123b24 Content-Type: text/plain; charset=ISO-8859-1 On 2 June 2010 17:20, Brian Candler wrote: > kevid wrote: > > please, is there a way to pre-determine the size (or capacity) of a > > string in ruby? > > Nope, strings are resized dynamically as required. But you could make > your own class which does this. > > It could, for example, delegate to an underlying String object, > intercepting calls which could make the string bigger, and either raise > an error or truncate the error if it exceeds the chosen size. > > But you likely do not need that ;) What is your aim ? --0016e6546f1e5427f50488123b24--