position static method
Returns the index of the first occurrence of needle in haystack,
or null if not found. offset starts the search from a position.
Implementation
static int? position(String haystack, String needle, {int offset = 0}) {
if (needle.isEmpty) return null;
final index = haystack.indexOf(needle, offset);
return index == -1 ? null : index;
}