How to find given string is palindrome or not without using
strreverse() function?

Answers were Sorted based on User's Feedback



How to find given string is palindrome or not without using strreverse() function?..

Answer / amiricks

Hi Nitin concept is correct but above code is not working fine
as it shows only not a palindrome....

here i have written one simple code any suggestions are most
welcome

val = Inputbox("Enter any string")
L= LEN(val)
for i = L to 1 step -1
v= mid(val,i,1)
va = va&v
Next
if val= va then
msgbox "Name is a Palindrome"
Else
Msgbox "Not a palindrome"
End if


Regards
Amit
umesh.amitkumar@gmail.com

Is This Answer Correct ?    15 Yes 2 No

How to find given string is palindrome or not without using strreverse() function?..

Answer / nitin jagjivan

Strng = "NITIN"
temp = "Pass"
dim arr()

Strng_Length = len(Strng)
redim arr(Strng_Length)

For i=1 to Strng_Length
arr(i-1)= mid(Strng,i,1)
Next

For i=1 to round(Strng_Length/2)
If instr(ucase(arr(i-1)),arr(Strng_Length-
i)) = 0 then
temp = "Fail"
End If
Next

If temp <> "Fail" then
msgbox "Given input is a palindrome"
Else
msgbox "Try another String, Not Pali"
End If

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More QTP Interview Questions

banking domain description for software tester for interview

0 Answers   Semantic Space,


How to capture data from images in QTP and produce them in Excel sheet ? please ans...

3 Answers   Sapient,


how to recall a function in QTP?

3 Answers   Ordain Solutions,


what sort of things what u put in Bug Report ?

1 Answers  


how to call a funtion in a script? i have saved the login scipt in notepad. with extension .vbs. But when i am calling the function with the keyword CALL <Function Name>. its not working out. can any one give me a clue how to call the external functions. with example.

3 Answers  






What is InStr()

6 Answers   Kanbay,


If you entered into yahoo mail with your valid user name and password , then you will get " welcome , username " (for example you will see , “welcome, Krishna” ) text on the top of the Inbox page , how can you test the user name is correct or not using QTP?

3 Answers   CTS,


can any body tell me all of the release dates of QTP?????..... thanks in adv!

3 Answers  


When I start recording any web application (either Mozilla or IE) QTP recognizes window instead of browser and also it does not show all the hierarchy tree of that particular web page. 1. Window("Mozilla Firefox").Check CheckPoint("Mozilla Firefox") 2. As everybody knows it should be browser("Mozilla Firefox").Check CheckPoint("Mozilla Firefox") I am using the windows vista, do you think it may be a problem of my settings in QTP or problem of my installation. Your kind responses will be appreciated. Thanks in advance. Satya

12 Answers  


How can we encrypt the username using recording mode in login window? There is 2 encrypted types what are it

1 Answers   TCS,


What are the different recording modes?

0 Answers  


Hi all , I am new at QTP I want a sample script to check validation messages(For java script or VB script) for login page with for web based application.. Any one can Help. I have to complete it in two days I need urgent help.. Ex. if I want to check mail.yahoo.com 1 > If user doed not exist it display "Username does not exist" 2> if invalid Uname and password then it display" Invalid Uname or pass" 3> Loing Sucssessfully. I want to check this types of application by using data table to give values of username and password.. Thanks

2 Answers  


Categories