danatrader, thanks again. The signature for strmid is strmid(str, first, count). So in your example, first (3) matched (not exceeded) the length of str, and count (2) did not. So I don't think this is pertinent to the case in the manual where count exceeds len(str).

> string mid = strmid(test, 3, 2);
> 0123 (3 exceeds) but you want two characters, so since 3 exceeds, the complete is returned and the 2 is pulled

By your logic, strmid(test, 3, 1) would return the second character in test ("the 1 is pulled"), but it doesn't; it still returns 'c'.

I would expect strmid to return count characters starting with first (like it says in the manual, by the way). And if count is more than what's remaining after first, the whole remainder is returned (same behavior as, e.g., MID() in Excel). There is no reason, at least that I can see, why strmid would return any character *before* first.