how to remove the spaces b/w the string.

how to remove the spaces b/w the string.

Home Forums Ask Expert how to remove the spaces b/w the string.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32688
    Sasha ZAP
    Moderator

      Hello saikrishna.m,

      Basically you can use the simple Replace VBScript function, for example:
      strData = Your String with all the spaces
      x = Replace(strData, ” “, “”)

      Thanks,
      ZAPTEST Team

      #32689
      sai krishna macherla
      Participant

        please check whether i have done it properly .

        Here i am trying to print the length of the string by removing spaces

        obj = Application(“Application”).View(“View”).Object(“kra.gov.qaen”).GetText
        strString = obj
        strString = Replace(strString, ” “, “”)
        msgbox len(strString)

        But i am getting length as Zero

        #32690
        Sasha ZAP
        Moderator

          Hello saikrishna.m,

          Yes, you’ve wrote it correctly but it seems the obj variable does not contain any data in it, you need to run the script in Debug mode and check if the obj variable gets a value – To run the test in a Debug mode you can do the following:
          Place a Breakpoint after this line of code:
          obj = Application(“Application”).View(“View”).Object(“kra.gov.qaen”).GetText
          Then run the test;When the test will stop in the Breakpoint check in the Watch List what is the value of the obj variable, if there is no value it means the object was not assigned properly.
          To understand better how to use ZAPTEST please refer to our online ZAPTEST Beginner Tutorial at:

          Tutorial

          Thanks,
          ZAPTEST Team

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.

        Virtual Expert

        ZAPTEST

        ZAPTEST Logo