# HG changeset patch # User Claus Gittinger # Date 1462342584 -7200 # Node ID 87d14d6f90ca46c6cd43b04930916f7b7b2f9762 # Parent d937d19b48710ac7b0cd814dd8caadee9440f440 #FEATURE by cg class: CharacterArray added: #unquote: comment/format in: #quote changed: #unquote diff -r d937d19b4871 -r 87d14d6f90ca CharacterArray.st --- a/CharacterArray.st Wed May 04 07:49:57 2016 +0200 +++ b/CharacterArray.st Wed May 04 08:16:24 2016 +0200 @@ -363,6 +363,7 @@ " ! ! + !CharacterArray class methodsFor:'pattern matching'! matchEscapeCharacter @@ -768,6 +769,7 @@ ^ Unicode32String ! ! + !CharacterArray methodsFor:'Compatibility-ANSI'! addLineDelimiters @@ -1722,22 +1724,32 @@ unquote "removes double quotes from the receiver. - This is the JavaSccript standard unquote function." - - |mySize| - - (mySize := self size) >= 2 ifTrue:[ - ((self first == $") and:[self last == $"]) ifTrue:[ - ^ self copyFrom:2 to:mySize-1 - ]. - ]. - ^ self + This is the JavaScript standard unquote function." + + ^ self unquote:$" " 'hello' quote unquote JavaScriptParser evaluate:'''hello''.quote.unquote' " +! + +unquote:quoteCharacter + "removes quoteCharacter from either end of the receiver." + + |mySize| + + (mySize := self size) >= 2 ifTrue:[ + ((self first == quoteCharacter) and:[self last == quoteCharacter]) ifTrue:[ + ^ self copyFrom:2 to:mySize-1 + ]. + ]. + ^ self + + " + '*hello*' unquote:$* + " ! ! @@ -5840,6 +5852,7 @@ "Modified: 17.4.1997 / 12:50:23 / cg" ! ! + !CharacterArray methodsFor:'special string converting'! asUnixFilenameString @@ -6896,6 +6909,7 @@ " ! ! + !CharacterArray methodsFor:'substring searching'! findRangeOfString:subString