fbpx

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 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32687
    sai krishna macherla
    Participant

      hiii, can you tell me, how to remove left side spaces and right spaces and middle spaces in string

      #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 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.

          Virtual Expert

          ZAPTEST

          ZAPTEST Logo