SilkTest Question 42: How to get substring of the string variable?

Imagine you have a string variable that holds the sixteen digits MasterCard or Visa debit card number. Can you name one of the many ways to obtain string with last four digits during run time?

The QA engineer may use multiple ways to get for testing purposes last four digits from sixteen digits string. Let’s name for practical purpose variables name with credit card number as sMCnumber and result string as sResult. The following two lines of 4test code would return the same test result:

sResult=Right (sMCnumber,4)
sResult=Substr(sMCnumber,13,4)

By the way I used one of the best practices to name string variables on 4test script.

No comments:

SilkTest interview questions for QA Testers