Hi,
I would like to strip off the last character of a string. Any good ideas on how to do that?
Brian
myString = myString[:-2]
myString[startIndex:endIndex]
eLink : Strip off last character of a string Strip off last character of a string Posted by brian.funke@motorolasolutions.com (Funke, Brian) On 05-03-2012 23:35 Hi, I would like to strip off the last character of a string. Any good ideas on how to do that? Brian [To post a comment, use the normal reply function] Forum: Content Server Builder Forum Content Server: Knowledge Center
Christopher MeyerDeveloper
String s = "this is my string to chop"
echo( s )
echo( s[1:length(s) -1] )
echo( s[:-2] )
J
David
From: eLink Entry: Content Server Builder Forum [mailto:componentbuilder@elinkkc.opentext.com]Sent: Thursday, May 03, 2012 11:40 PMTo: eLink RecipientSubject: Strip off last character of a string
Strip off last character of a string
Posted bybrian.funke@motorolasolutions.com (Funke, Brian) On 05-03-2012 23:35
[To post a comment, use the normal reply function]
Forum:
Content Server Builder Forum
Content Server:
Knowledge Center
Thanks guys. That helped.