TIP: Click on subject to list as thread! ANSI
echo: wildcat!_support
to: All
from: Robert Wolfe
date: 2019-01-11 16:32:24
subject: Re: [Developers] Replacing Text

Sharing this update to my last posting as well:

                     -------- Forwarded Message ---------
Original: DATE..... 11 Jan 2019,  04:30p
Original: FROM..... Developers{at}winserver.com
Original: TO....... ROBERT WOLFE
Original: SUBJECT.. RE: [Developers] Replacing Text
Original: FORUM.... Private Email

On Jan 11, 2019 04:19pm, ROBERT WOLFE wrote to Developers{at}winserver.com:

 RW> On Jan 11, 2019 05:01am, Developers{at}winserver.com wrote to ROBERT WOLFE:

 >> Hi

 >> This maybe a simple question but not sure of the best way to do it.

 >> I have a variable - for example say it contains "Mr John Smith"
 >> I need to change this variable to = "Mr%20John%20Smith"
 >> So basicially finding a space and replacing it with %20

 >> Can anyone suggest the best way to do this ?

 RW> Dave, I believe something like this might help you out for a starting
 RW> point:

 RW> //
 RW> // Will search for a spaces in a string and replace it with %20/
 RW> // Coded by Robert Wolfe 
 RW> //

The same code converted into a function (with example usage in a full WCX)
could be used as follows:

//
// Will search for a spaces in a string and replace it with %20/
// Coded by Robert Wolfe 
//

#include "util.wch"
#include "cmdline.wch"

if (GetNode() = 0) then
    LoginSystem()
end if

dim string1 as string = "Mr. John Doe, Sr."

function string2 (string1 as string) as string
  dim char as string = ""
  dim index as integer = 0
  dim temp as string = ""
  for index = 1 to len(string1)
      char = mid(string1, index, 1)
      if char = " " then char = "%20"
      temp = temp + char
  next index
  string2 = temp
end function

print "string1 = "; string1
print "string2 = " ; string2(string1)

... Platinum Xpress & Wildcat!..... Nice!!!!



-!-------------------------------------------------------------------
To unsubscribe, send e-mail to wclistserve{at}winserver.com with
UNSUBSCRIBE Developers in the message body on a line by itself.
To contact the list admin, e-mail ListAdmin{at}winserver.com
-!-------------------------------------------------------------------



                     ----- End of Forwarded Message -----

... Platinum Xpress & Wildcat!..... Nice!!!!
--- Platinum Xpress/Win/WINServer v3.0pr5
* Origin: Omicron Theta (1:116/17)
SEEN-BY: 15/0 19/36 34/999 90/1 104/57 116/18 120/331 123/140 153/7715 218/700
SEEN-BY: 220/60 222/2 229/426 230/150 152 250/1 261/38 100 266/512 267/155
SEEN-BY: 275/100 282/1031 1056 291/1 111 320/119 219 340/400 342/13 396/45
SEEN-BY: 633/0 267 280 281 412 509 712/132 620 848 770/1 801/161 189 3634/12
SEEN-BY: 5020/1042
@PATH: 116/17 18 261/38 712/848 633/280 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.