FF_UNWRAP

Started by Paul Squires, August 19, 2015, 01:44:27 PM

Previous topic - Next topic

Paul Squires




''
''  FF_UNWRAP
''  Remove paired characters to the beginning and end of a string.
''
''  It is particularly useful for removing text with parenthesess,
''  quotes, brackets, etc.
''  For example:  FF_UnWrap("<Paul>", "<", ">") results in Paul
''
''  If only one unwrap character/string is specified then that character
''  or string is used for both sides.
''  For example:  FF_UnWrap("'Paul'", "'") results in Paul
''
''  If no wrap character/string is specified then double quotes are used.
''  For example:  FF_UnWrap(""Paul"") results in Paul
''
Function FF_UnWrap Overload ( ByRef sMainString As String, _
                              ByRef sLeftChar   As String, _
                              ByRef sRightChar  As String _
                              ) As String
   sMainString = LTrim(sMainString, sLeftChar)
   Function = Rtrim(sMainString, sRightChar)
End Function

Function FF_UnWrap Overload ( ByRef sMainString As String, _
                              ByRef sLeftChar   As String = Chr(34) _
                              ) As String
   sMainString = LTrim(sMainString, sLeftChar)
   Function = Rtrim(sMainString, sLeftChar)
End Function


Paul Squires
PlanetSquires Software