dcsimg
Results 1 to 3 of 3

Thread: Skip a String from Replace, if it has any suffix or postfix <VBScript>

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2019
    Posts
    4

    Skip a String from Replace, if it has any suffix or postfix <VBScript>

    I have a one Big File, In which I need to replace one string from the another.
    File is getting Generated from the Jenkins Build and to process that, its using VBscript.

    Here is the Deal for me, I can simply replace the string like this,

    Replace(str_Renamed, "Variables", "Variables_Base", 1, -1, 1)

    but in the same file "variables" is also there with suffix and postfix, these particular string i need to skip from the replace.

    does VBscript has any function which can be useful for above conditions.
    I am also looking for the answers, If I would find anything for it. I will post here.

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,740

    Re: Skip a String from Replace, if it has any suffix or postfix <VBScript>

    Are there other characters next to "Variables" when it is without the postfix/suffix, i.e. could you use a space or space characters to isolate the match.
    e.g.
    Replace(str_Renamed, " Variables ", " Variables_Base ", 1, -1, 1)
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2019
    Posts
    4

    Re: Skip a String from Replace, if it has any suffix or postfix <VBScript>

    Thanks for the Reply, i did try the same way as you are suggesting but its not working.

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width