khfaraaz82@gmail.com | c526fe9 | 2012-08-10 22:09:13 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Testcase Name : substr01.aql |
| 3 | * Description : Test substring2(string,position) built in function. |
| 4 | * Success : Yes |
| 5 | * Date : 18th April 2012 |
| 6 | */ |
| 7 | |
| 8 | write output to nc1:"rttest/string_substr01.adm"; |
| 9 | |
| 10 | let $str1:="Hello World" |
| 11 | let $str2:=substring2($str1,10) |
| 12 | |
| 13 | let $str3:="This is a test string" |
| 14 | let $str4:=substring2($str3,21) |
| 15 | |
| 16 | let $str5:="This is a test string" |
| 17 | let $str6:=substring2($str5,22) |
| 18 | |
| 19 | let $str7:="This is a test string" |
| 20 | let $str8:=substring2($str7,0) |
| 21 | |
| 22 | let $str9:="This is a test string" |
| 23 | let $str10:=substring2($str9,-1) |
| 24 | |
| 25 | let $str11:="This is a test string" |
| 26 | let $str12:="This is a another test string" |
| 27 | let $str13:=substring2(string-concat([$str11,$str12]),21) |
| 28 | |
| 29 | let $str14:=substring2("UC Irvine",string-length("UC Irvine")/2) |
| 30 | return { "str2":$str2,"str4":$str4,"str6":$str6,"str8":$str8,"str10":$str10,"str13":$str13,"str14":$str14} |