webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Replace Special Characters

  • 1.  Replace Special Characters

    Posted Tue November 01, 2005 07:44 PM

    Hi folks,

    I wish to replace the special characters like !,@,#,$ etc with the desired string. I was trying to utilise the “pub.string:replace” service to replace the special characters but was able to replace just one string but not the case where either of the special chars occur in a string (! or @ or # or $ etc.,)

    Really appreciate if someone could shoot the solution that could replace any of the strings with a desired string

    Thanks,
    AJ


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Replace Special Characters

    Posted Tue November 01, 2005 11:07 PM

    Hello,

    Yemi Bedu


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: Replace Special Characters

    Posted Tue November 01, 2005 11:43 PM

    Thanks Yemi Bedu. Thats what I was looking for.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 4.  RE: Replace Special Characters

    Posted Wed November 02, 2005 04:09 PM

    Hi,

    I’m stuck in a similar situation , when I use pub.string.replace
    I need to replace the value in between 2 <get_eco> tags in a string by another value coming from another string, The problem is when I hardcode the search [/<get_eco>(…)<get_eco>] the service looks at teach character individually and makes a mess of the whole string. I just can’t find the right expression to replace any character between these 2 tags.

    Thanks in advance, I have also tried word boundaries with no result


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: Replace Special Characters

    Posted Wed November 02, 2005 09:08 PM

    Hello,

    Yemi Bedu


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: Replace Special Characters

    Posted Wed November 02, 2005 09:23 PM

    Monzoon,

    what is ur expected output should be and do you want replace <get_eco> to </get_eco>?

    HTH,
    RMG


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 7.  RE: Replace Special Characters

    Posted Wed November 02, 2005 09:42 PM

    Thanks Yemi Bedu,

    Except that the Dog value is replacing my whole search string in my string. What I got is the equivalent of <get_eco>dog<get_eco>boydog

    I did however solve the problem using another variable -replace1- for example containing the -dog- value, Then I used

    <get_eco>%replace1%<get_eco>

    as my replaceString value and checked the Perform variable substitution box. and I got:

    <get_eco>dog<get_eco>boy<get_eco>dog<get_eco>

    Thanks a lot for your help and the references.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 8.  RE: Replace Special Characters

    Posted Wed November 02, 2005 10:37 PM

    Hello,

    Yemi Bedu


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Replace Special Characters

    Posted Mon January 16, 2006 09:13 PM

    Hello,
    Can any one tell me how can I use pub.string.replace to remove all the special charactors. In staer of giving list of charatctoes to be removed can I give the pattern of characters to allowed something like [0-9] , [a-z], [A-Z], ~,*,^
    Since I am dealing with EDI string the resultant string should have the special charactors which are mandetory for an EDI string.
    It would be grate if some one can let me know exact sintax for
    searchString:
    replaceString:
    useRegex:true

    Thanks in adavance


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 10.  RE: Replace Special Characters

    Posted Thu January 19, 2006 08:06 PM

    Why do you need to replace them?
    May be you’re having a character set encoding problem.
    Can you explain a bit more.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 11.  RE: Replace Special Characters

    Posted Thu January 19, 2006 10:53 PM

    Some special characters are causing problems to when they are sent in EDI.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 12.  RE: Replace Special Characters

    Posted Fri January 20, 2006 07:40 PM

    Can you be more specific about “special characters” and “problems?” What are the characters that are causing a problem? What are the specific problems?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 13.  RE: Replace Special Characters

    Posted Mon January 23, 2006 04:01 AM

    If you’re doing UNEDIFACT, just setting “Escape Character” when doing wm.b2b.edi:convertToString will allow the “special characters” to be handled properly. Not familiar enough with X12 to know if it’s a standard thing to do…


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 14.  RE: Replace Special Characters

    Posted Wed August 30, 2006 06:51 AM

    I am using (SAP BC 4.6), an string replace function to convert the input string in to an desired string!.

    Eg:

    My input string is : “A.Ö.KRANKE$NHAUS D.BARMH.BRÜDER”

    an I expect the output like: “A.O.KRANKESNHAUS D.BARMH.BRUDER”

    [FONT=Arial]Can anybody help me in this regard

    -C@rthik:(

    [/FONT]


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 15.  RE: Replace Special Characters

    Posted Wed August 30, 2006 04:26 PM

    X12 doesn’t use escape chars. One needs to explicitly remove delimiters that appear in the data.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 16.  RE: Replace Special Characters

    Posted Wed August 30, 2006 04:29 PM

    This is a character set issue. There are threads on the forums and sources on the web that cover conversions.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 17.  RE: Replace Special Characters

    Posted Fri May 10, 2013 10:23 AM

    If I want to replace special characters [®,©,™] one with each html entity how can I do with wild cards

    Where my inString is This is registered ®,this is copyright ©,this is trademark ™
    what should be the searchString
    what should be the replaceString where we have to replace ® = reg,© = copy ,™ = trade

    out put should be This is registered reg,this is copyright copy,this is trademark trade

    Is it possible with a single string:replace service :?:

    Any help is appreciated.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 18.  RE: Replace Special Characters

    Posted Tue May 21, 2013 12:17 PM

    You have to explicit replace service and hard code the chars that you want to replace (each char with one replace) and there is no other way to handle it other than store these spl chars in the DB table and replace with null and this eliminates hardcoding and configurable from the DB using a generic framework service.

    HTH,
    RMG


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 19.  RE: Replace Special Characters

    Posted Wed May 29, 2013 04:53 AM

    I have used a java service which will handle all the special characters.

    Thanks,


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 20.  RE: Replace Special Characters

    Posted Wed May 29, 2013 12:18 PM

    good try…thanks as long it is working for you!


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods