Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zazen!news From: pschwart@vms.macc.wisc.edu (Paul Schwartz) Newsgroups: comp.lang.pascal Subject: Re: Dose anybody have space det. code!!!!!!!!! Message-ID: <1991Apr23.133227.10746@macc.wisc.edu> Date: 23 Apr 91 13:21:36 GMT Sender: news@macc.wisc.edu (USENET News System) Organization: University of Wisconsin Academic Computing Center Lines: 20 In article <1991Apr22.060051.2238@nuchat.sccsi.com>, robby@nuchat.sccsi.com (Robert Oliver Jr.) writes... >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. In Turbo Pascal you can treat a string like an array, therefore for i := 1 to length(my_string) do { for each char in the string } if my_string[i] = chr(20) then { if the char is a space } my_string[i] = chr(45) { replace it with a - } - Z - +-----------------------------------------------------------------------------+ | PauL M SchwartZ | There are many causes worth dying for, | | PSCHWART@macc.wisc.edu | but none worth killing for. | | PSCHWART@wiscmacc.BitNet | - Gandhi | +-----------------------------------------------------------------------------+