@genexus/web-standard-functions
Version:
GeneXus JavaScript standard functions library for web generators
18 lines • 531 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.indexOf = void 0;
const length_1 = require("./length");
/**
* Return position for first pattern occurence.
* @param {string} target
* @param {string} pattern
* @param {number} from
* @return number
*/
const indexOf = (target, pattern, from = 1) => {
if (from < 1 || from > (0, length_1.length)(target))
return 0;
return target.indexOf(pattern, from - 1) + 1;
};
exports.indexOf = indexOf;
//# sourceMappingURL=indexOf.js.map