Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Monday, 22 February 2021

Write a script to find the number of letters present in the given string ?

Write a script  to find out the number of “T” in the given string?

x="UFT test automation"

y=split(x,"")

count=0 

total=0

For i=lbound(y) to ubound(y) step 1

    z=len(y(i))

    count=0

  For j=1 to z step 1

      a=mid(y(i),j,1)

      if (a="T" or a="t") then

         count=count+1

      end if

  Next

  total=total+count

  msgbox "Given string has "&count&" letters"

Next

msgbox "Total letters= "&total