views:

39

answers:

1

Is there any inbuild function to find out the last occurrence of a string pattern in a string in action script .

+1  A: 

Yes, check out the lastIndexOf method of the String object.

PS. If by string pattern you mean a regular expression rather than a literal string, you could use the match method instead, passing a RegExp and setting the g (global) flag; then you could check the last match in the returned result.

Juan Pablo Califano
thanks..n sry..i was little confused about tht since it searches from right to left .Now i got the logic to use it ..thanks again.
Bhaswanth