Changeset 39838 in project


Ignore:
Timestamp:
04/05/21 01:14:06 (6 weeks ago)
Author:
Kon Lovett
Message:

rel 2.5.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/string-utils

    r39546 r39838  
    204204<enscript language=scheme>
    205205(import string-utils)
     206</enscript>
     207
     208==== string-unzip
     209
     210<procedure>(string-unzip STR DELIMITERS) -> (list-of string) (list-of string)</procedure>
     211
     212Returns a {{list}} of substrings of STR & a {{list}} of the characters, from
     213DELIMITERS, separating those substrings.
     214
     215; STR : {{string}} ; version string.
     216; DELIMITERS : {{string}} ; string of version component delimiter characters.
     217
     218<enscript language=scheme>
     219(string-unzip "a.2,c" "$,.")
     220;=> ("a" "2" "c") ("." ",")
     221</enscript>
     222
     223==== string-zip
     224
     225<procedure>(string-zip PARTS PUNCS) -> string</procedure>
     226
     227Returns a {{string}} formed from the concatenation of the PARTS and the
     228interspersion of the PUNCS.
     229
     230; PARTS : {{(list-of string)}} ; version components.
     231; PUNCS : {{(list-of string)}} ; version component separators.
     232
     233<enscript language=scheme>
     234(string-zip ("a" "2" "c") ("." ","))
     235;=> "a.2,c"
    206236</enscript>
    207237
     
    362392== Version history
    363393
     394; 2.5.0 : Add {{string-zip}} & {{string-unzip}}.
    364395; 2.4.0 : Add {{string-longest-common-prefix/suffix}}, {{string-longest-prefix/suffix}}, {{number->padded-string}}, {{list-as-string}}, {{string-trim-whitespace-both}}.
    365396; 2.3.2 : Deprecate {{unicode-char->string}}, fixes for {{memoized-string}} & {{string-utils}} modules, {{ascii-codepoint?}} & {{unicode-surrogate?}} are not predicates.
     
    375406Copyright (C) 2010-2021 Kon Lovett.  All rights reserved.
    376407
    377 Permission is hereby granted, free of charge, to any person obtaining a
    378 copy of this software and associated documentation files (the Software),
    379 to deal in the Software without restriction, including without limitation
    380 the rights to use, copy, modify, merge, publish, distribute, sublicense,
    381 and/or sell copies of the Software, and to permit persons to whom the
    382 Software is furnished to do so, subject to the following conditions:
    383 
    384 The above copyright notice and this permission notice shall be included
    385 in all copies or substantial portions of the Software.
    386 
    387 THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    388 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    389 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    390 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
    391 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
    392 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    393 OTHER DEALINGS IN THE SOFTWARE.
     408Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
     409conditions are met:
     410
     411  Redistributions of source code must retain the above copyright notice, this list of conditions and the following
     412    disclaimer.
     413  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
     414    disclaimer in the documentation and/or other materials provided with the distribution.
     415  Neither the name of the author nor the names of its contributors may be used to endorse or promote
     416    products derived from this software without specific prior written permission.
     417
     418THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
     419OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     420AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
     421CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     422CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     423SERVICESLOSS OF USE, DATA, OR PROFITSOR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     424THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     425OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     426POSSIBILITY OF SUCH DAMAGE.
Note: See TracChangeset for help on using the changeset viewer.