Version: v0.7.1 - Beta.  We welcome contributors & feedback.

String.lastReplaceCount

String.lastReplaceCount() -> number

Description

Returns the number of substitutions made during the most recent call to replace.

'aa bb aa'.replace('aa', 'XX')  //= 'XX bb XX'
String.lastReplaceCount()       //= 2

'aa bb cc'.replace('zz', 'xx')  //= 'aa bb cc'
String.lastReplaceCount()       //= 0

See Also