Advanced Customizations, Overrides, and Extensions » ePublisher Platform XSLT Extensions » StringUtilities » string ReplaceWithExpressionForCount (string input, string searchExpressionAsString, string replacement, int count)
string ReplaceWithExpressionForCount (string input, string searchExpressionAsString, string replacement, int count)
 
Replace 'count' occurrences of 'searchExpressionAsString' in 'input' with 'replacement'.
Parameters:
input
The input.
searchExpressionAsString
The search expression as string.
replacement
The replacement.
count
Number of.
Returns:
A string.
Replace first run of 3-4 "a"s with ". ".
<xsl:value-of select="wwstring:ReplaceWithExpression('The end of aa sentenceaaaaalways leaves me sad.', 'a{3-4}', '. ', 1)" />
Was this helpful?
Last modified date: 10/14/2020