@@ -37,6 +37,7 @@ import numGraphemeClusters = require( '@stdlib/string/num-grapheme-clusters' );
3737import pad = require( '@stdlib/string/pad' ) ;
3838import pascalcase = require( '@stdlib/string/pascalcase' ) ;
3939import percentEncode = require( '@stdlib/string/percent-encode' ) ;
40+ import prevGraphemeClusterBreak = require( '@stdlib/string/prev-grapheme-cluster-break' ) ;
4041import removeFirst = require( '@stdlib/string/remove-first' ) ;
4142import removeLast = require( '@stdlib/string/remove-last' ) ;
4243import removePunctuation = require( '@stdlib/string/remove-punctuation' ) ;
@@ -428,6 +429,24 @@ interface Namespace {
428429 */
429430 percentEncode : typeof percentEncode ;
430431
432+ /**
433+ * Returns the previous extended grapheme cluster break in a string before a specified position.
434+ *
435+ * @param str - input string
436+ * @param fromIndex - position (default: str.length-1)
437+ * @throws first argument must be a string
438+ * @throws second argument must be an integer
439+ * @returns previous grapheme break position
440+ *
441+ * @example
442+ * var out = ns.prevGraphemeClusterBreak( 'अनुच्छेद', 2 );
443+ * // returns 0
444+ *
445+ * out = ns.prevGraphemeClusterBreak( '🌷', 1 );
446+ * // returns -1
447+ */
448+ prevGraphemeClusterBreak : typeof prevGraphemeClusterBreak ;
449+
431450 /**
432451 * Removes the first character of a string.
433452 *
@@ -739,6 +758,7 @@ interface Namespace {
739758 *
740759 * @param str - input string
741760 * @param search - search string
761+ * @param fromIndex - index at which to start the search (default: 0)
742762 * @returns substring
743763 *
744764 * @example
@@ -756,6 +776,14 @@ interface Namespace {
756776 * @example
757777 * var out = ns.substringAfter( 'beep boop', 'xyz' );
758778 * // returns ''
779+ *
780+ * @example
781+ * var out = ns.substringAfter( 'beep boop', 'beep', 5 );
782+ * // returns ''
783+ *
784+ * @example
785+ * var out = ns.substringAfter( 'beep boop beep baz', 'beep', 5 );
786+ * // returns ' baz'
759787 */
760788 substringAfter : typeof substringAfter ;
761789
@@ -764,6 +792,7 @@ interface Namespace {
764792 *
765793 * @param str - input string
766794 * @param search - search value
795+ * @param fromIndex - index of last character to be considered beginning of a match (default: `str.length`)
767796 * @returns substring
768797 *
769798 * @example
@@ -785,6 +814,10 @@ interface Namespace {
785814 * @example
786815 * var out = ns.substringAfterLast( 'Hello World', '' );
787816 * // returns ''
817+ *
818+ * @example
819+ * var out = ns.substringAfterLast( 'beep boop baz', 'p b', 6 );
820+ * // returns 'oop baz'
788821 */
789822 substringAfterLast : typeof substringAfterLast ;
790823
0 commit comments