Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!menudo.uh.edu!nuchat!lobster!urchin!f1999.n106.z1.fidonet.org!Harold.Ruby From: Harold.Ruby@f1999.n106.z1.fidonet.org (Harold Ruby) Newsgroups: comp.lang.pascal Subject: Re: Dose anybody have space det. code!!!!!!!!! Message-ID: <11817.281458E3@urchin.fidonet.org> Date: 24 Apr 91 03:06:08 GMT Sender: ufgate@urchin.fidonet.org (newsout1.26) Organization: FidoNet node 1:106/1999 - The Instrument MEGA, Deer Park TX Lines: 25 on 21 Apr 91 15:35:36 Robert Oliver Jr. said to All >dose any body have some code that can detect a space in a string[40] >and replace it with a -, but if there is not a space then dont >do anything ? >any help would be greatlee appreated. procedure findspace (var thestring:string); var loc:integer; begin if length (thestring)=0 then exit; for loc:=1 to length(thestring) do if thestring[loc]=' ' then thestring[loc]:='-'; end; or {same header} begin repeat if pos(' ',thestring)<>0 then thestring[pos(' ',thestring)]:='-'; until pos(' ',thestring)=0; end; {note: the 2nd one requires no "loc" variable } Harold