best way to truncate string
Posted: 23 Dec 2016, 02:17
I want to create a function called 'StrTruncate'
e.g. StrTruncate(ByRef vText, vLenNew)
what is the best way to truncate a string?
StringTrimRight, will be phased out
SubStr
VarSetCapacity, potentially reduces the var capacity affecting future text append
insert a null character
some other way?
thank you!
PS regarding terminology
if a var is too small to append the desired text,
a new larger-capacity replacement var with the same name is created, and the text moved over,
is there a succinct term/phrase to describe this?
e.g. StrTruncate(ByRef vText, vLenNew)
what is the best way to truncate a string?
StringTrimRight, will be phased out
SubStr
VarSetCapacity, potentially reduces the var capacity affecting future text append
insert a null character
some other way?
thank you!
PS regarding terminology
if a var is too small to append the desired text,
a new larger-capacity replacement var with the same name is created, and the text moved over,
is there a succinct term/phrase to describe this?