Changeset 39546 in project
- Timestamp:
- 01/29/21 03:05:31 (4 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/eggref/5/string-utils
r39052 r39546 206 206 </enscript> 207 207 208 ==== string-trim-whitespace-both 209 210 <procedure>(string-trim-whitespace-both S) -> string</procedure> 211 212 Returns the {{string}} {{S}} with whitespace trimmed. 213 214 ==== list-as-string 215 216 <procedure>(list-as-string LS) -> string</procedure> 217 218 Returns the {{list}} {{LS}} written to a {{string}}. 219 220 ==== number->padded-string 221 222 <procedure>(number->padded-string N WIDTH [PADCHAR [BASE]]) -> string</procedure> 223 224 ; N : {{number}} ; source 225 ; WIDTH : {{fixnum}} ; field width 226 ; PADCHAR : {{char}} ; padding character 227 ; BASE : {{fixnum}} ; number conversion base 228 208 229 ==== string-fixed-length 209 230 210 <procedure>(string-fixed-length S N [pad-char: #\space] [trailing: "..."]) - -> string</procedure>211 212 Returns the string{{S}} with the {{string-length}} fixed to {{N}}.231 <procedure>(string-fixed-length S N [pad-char: #\space] [trailing: "..."]) -> string</procedure> 232 233 Returns the {{string}} {{S}} with the {{string-length}} fixed to {{N}}. 213 234 214 235 A shorter string is padded. A longer string is truncated, & suffixed with the … … 217 238 ==== string-longest-common-prefix 218 239 219 <procedure>(string-longest-common-prefix CANDIDATE OTHERS) --> (or boolean string)</procedure> 240 <procedure>(string-longest-common-prefix STRINGS) -> string</procedure> 241 242 Returns the longest comment prefix of {{STRINGS}}. 243 244 ; STRINGS : {{(list-of string)}} 245 246 ==== string-longest-common-suffix 247 248 <procedure>(string-longest-common-suffix STRINGS) -> string</procedure> 249 250 Returns the longest comment suffix of {{STRINGS}}. 251 252 ; STRINGS : {{(list-of string)}} 253 254 ==== string-longest-prefix 255 256 <procedure>(string-longest-prefix CANDIDATE OTHERS) -> (or boolean string)</procedure> 220 257 221 258 Returns the member with the longest comment prefix of {{CANDIDATE}} from 259 {{OTHERS}}, or {{#f}}. 260 261 ; CANDIDATE : {{string}} 262 ; OTHERS : {{(list-of string)}} 263 264 ==== string-longest-suffix 265 266 <procedure>(string-longest-suffix CANDIDATE OTHERS) -> (or boolean string)</procedure> 267 268 Returns the member with the longest comment suffix of {{CANDIDATE}} from 222 269 {{OTHERS}}, or {{#f}}. 223 270 … … 315 362 == Version history 316 363 364 ; 2.4.0 : Add {{string-longest-common-prefix/suffix}}, {{string-longest-prefix/suffix}}, {{number->padded-string}}, {{list-as-string}}, {{string-trim-whitespace-both}}. 317 365 ; 2.3.2 : Deprecate {{unicode-char->string}}, fixes for {{memoized-string}} & {{string-utils}} modules, {{ascii-codepoint?}} & {{unicode-surrogate?}} are not predicates. 318 366 ; 2.3.1 : Minor optimization. … … 321 369 ; 2.1.0 : Add {{utf8-string-interpolation}}. 322 370 ; 2.0.0 : C5 release. 323 ; 1.6.0 : Add {{string-utils-extensions}}.324 ; 1.5.6 : Add types.325 ; 1.5.5 : .326 ; 1.5.4 : .327 ; 1.5.3 : {{memorize-string}} -> {{global-string}}.328 ; 1.5.2 : Fix {{string+}} & {{memorize-string}}.329 ; 1.5.1 : Fix {{string+}} unicode support.330 ; 1.5.0 : Deprecate {{make-string*}} for {{make-string+}}, add {{memorize-string}} & {{string+}}.331 ; 1.4.0 : Add string-interpolation modules.332 ; 1.3.1 : Fix {{hex_to_str}}, {{hex_to_blob}}.333 ; 1.3.0 : Add {{hex->string}}, {{hex_to_str}}, {{hex_to_blob}}.334 ; 1.2.5 : Remove [[lookup-table]].335 ; 1.2.2 : Unicode string construction a little faster. Removed {{blob->hex}}.336 ; 1.2.1 : Added {{blob->hex}}.337 ; 1.2.0 : Added "generic" bytes to hexadecimal string.338 ; 1.1.0 : Split into separate modules. Added some UTF-8 support.339 ; 1.0.0 : Hello340 371 341 372 342 373 == License 343 374 344 Copyright (C) 2010-202 0Kon Lovett. All rights reserved.375 Copyright (C) 2010-2021 Kon Lovett. All rights reserved. 345 376 346 377 Permission is hereby granted, free of charge, to any person obtaining a
Note: See TracChangeset
for help on using the changeset viewer.