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

Find a largest and smallest word in given string.

 Write a program to find the largest and smallest word in given string...?

Smallest word: an

Largest word: extraordinary 

str1="Hardships often prepare ordinary people for an extraordinary destiny"

SplitString=split(str1, " ")

For each x in SplitString

    If len(x)=2 Then

       Msgbox "Smallest word:  "&x

    elseif len(x)=12 then

        Msgbox "Largest word:  "&x

    End If

Next

Output:





No comments:

Post a Comment

Note: only a member of this blog may post a comment.