Engineering Requirements Management

Engineering Requirements Management

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Remove Double Quotes from a string

  • 1.  Remove Double Quotes from a string

    Posted Wed November 04, 2020 07:35 AM

    I am very new to dxl scripting, I want to know how to replace all the double quotes present in a string with nothing.





    #DOORS
    #SupportMigration
    #EngineeringRequirementsManagement
    #Support
    #Sustainability


  • 2.  RE: Remove Double Quotes from a string

    Posted Mon November 09, 2020 05:33 PM

    You probably already noticed there is no string "replace" function in DXL. So I think most people have written their own functions that do this ...at least that is what we have done.

    For your immediate issue something like this should work:

    Regexp lMatch = regexp2 "\"\"" string lText = "\"\"hel\"\"lo\"\"Goo\"\"dbye\"\"" while(lMatch lText){ lText = replaceRichText(lText, start(0), 2, "") } print lText

    But if you are going to be writing scripts in the future, you are probably better off creating your own function that you can reuse. You can probably search the forum and find working examples.





    #SupportMigration
    #Sustainability
    #EngineeringRequirementsManagement
    #Support
    #DOORS