UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

21 lines 647 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.lastIndexOf = void 0; const length_1 = require("../text/length"); /** * Return position for last pattern occurence. Search is done backguard * @param {string} target * @param {string} pattern * @param {number} from * @return number */ const lastIndexOf = (target, pattern, from) => { if (from === undefined) { from = target.length; } if (from < 1 || from > (0, length_1.length)(target)) return 0; return target.lastIndexOf(pattern, from - 1) + 1; }; exports.lastIndexOf = lastIndexOf; //# sourceMappingURL=lastIndexOf.js.map