www.delorie.com/gnu/docs/guile/guile_192.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.6 String Modification

These procedures are for modifying strings in-place. This means that the result of the operation is not a new string; instead, the original string's memory representation is modified.

Scheme Procedure: string-set! str k chr
C Function: scm_string_set_x (str, k, chr)
Store chr in element k of str and return an unspecified value. k must be a valid index of str.

Scheme Procedure: string-fill! str chr
C Function: scm_string_fill_x (str, chr)
Store char in every element of the given string and return an unspecified value.

Scheme Procedure: substring-fill! str start end fill
C Function: scm_substring_fill_x (str, start, end, fill)
Change every character in str between start and end to fill.

 
(define y "abcdefg")
(substring-fill! y 1 3 #\r)
y
=> "arrdefg"

Scheme Procedure: substring-move! str1 start1 end1 str2 start2
C Function: scm_substring_move_x (str1, start1, end1, str2, start2)
Copy the substring of str1 bounded by start1 and end1 into str2 beginning at position start2. str1 and str2 can be the same string.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003