Get Last Position String In PowerBuilder
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
//==================================================================== // Function: gf_last_pos() //-------------------------------------------------------------------- // Description: Alternative Function To Find the Last Position Of a String In another String //-------------------------------------------------------------------- // Arguments: // readonly string as_string1: String the String In which you want search as_string2 // readonly string as_string2: String the Last String you wantTo seach In as_string 1 //-------------------------------------------------------------------- // Returns: Long Position Of Last as_string2 In string1 0 If as_string2 does Not exist In as_string1 //==================================================================== Long ll_Pos String ls_string1 , ls_string2 ll_Pos = Pos( as_string1 , as_string2 , 1 ) If ll_Pos = 0 Then Return 0 ls_string1 = Reverse(as_string1) ls_string2 = Reverse(as_string2) Return (Len(as_string1) - Len(as_string2) - Pos ( ls_string1 , ls_string2) + 2) |
Good Luck!
Subscribe
Login
0 Comments