Replace Substring from end ?

Results 1 to 2 of 2

Thread: Replace Substring from end ?

  1. #1
    Join Date
    Dec 1969

    Default Replace Substring from end ?

    Does anyone know how to replace a substring starting at the end <BR>of a string, using VBScript ? I know that this is easy to do with Javascript, but haven&#039;t seen a corresponding version in VBS.<BR><BR>Here&#039;s what I want to do<BR><BR>oldSubstring = "on"<BR>newSubstring = "off"<BR><BR>bigString = "The man got off the horse, Then he kicked the dirt on his boots."<BR><BR>replaceFromEnd(bigString,newSubstri ng,oldSubstring)<BR><BR>bigString would then equal "The man got off the horse, Then he kicked the dirt off his boots."<BR><BR>BTW, no that&#039;s not an actual string I&#039;m dealing with. But it&#039;s probably more interesting to you than the strings I&#039;m actually trying to change ;-)<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Replace Substring from end ?

    you can use a combination of InstrREV and Replace....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts