home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / diverses / leda / prog / basic / string.c < prev   
Encoding:
C/C++ Source or Header  |  1991-11-15  |  386 b   |  23 lines

  1. #include <LEDA/basic.h>
  2.  
  3. main()
  4.  
  5.   file_istream IN(read_string("input from file: "));
  6.  
  7.   string s1 = read_string("replace all s1 = ");
  8.   newline;
  9.   string s2 = read_string("by s2 = ");
  10.  
  11.   string s3 = read_string("delete all s3 = ");
  12.  
  13.   while (IN)
  14.   { string s;
  15.     s.read_line(IN);
  16.     s = s.replace_all(s1,s2);
  17.     s = s.del_all(s3);
  18.     cout << s.format("%s\n");
  19.    }
  20.   newline;
  21. }
  22.