Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: String manipulations

New Message Reply About this list Date view Thread view Subject view Author view

Mike Pilone (mpilone@VT.EDU)
Sat, 17 Feb 2001 18:13:32 -0500


Message-ID:  <01021718133200.30828@spg-laptop5>
Date:         Sat, 17 Feb 2001 18:13:32 -0500
From: Mike Pilone <mpilone@VT.EDU>
Subject:      Re: String manipulations

I used an old pascal book I had from high
school. A list the book gives is:

int Length(str : string)
int Pos(substr, str : string)
string Concat(s1, s2, s3, ...)
string Copy(str : string, index, count : integer)

void Delete(var str : string; index, count : integer)
void Insert(source : string; var dest : string)

You can also use most math operations, like assignment and addition on
strings:

str1 := str2 + str3;

and

if (str1 = str2) then
...

Hope that helps,
-mike

--
--
Mike Pilone                                Computer Scientist
mpilone@slac.com       http://www.slac.com/~mpilone/


New Message Reply About this list Date view Thread view Subject view Author view

Home  |   Notes  |   Languages  |   Programs  |   Homework
copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Class site maintained by Stephen H. Edwards <edwards@cs.vt.edu>