(str, substr string)
| 670 | } |
| 671 | |
| 672 | func lastIndexOf(str, substr string) (int64, error) { |
| 673 | runes := []rune(str) |
| 674 | if substr == "" { |
| 675 | return int64(len(runes)), nil |
| 676 | } |
| 677 | |
| 678 | if len(str) < len(substr) { |
| 679 | return -1, nil |
| 680 | } |
| 681 | return lastIndexOfOffset(str, substr, int64(len(runes)-1)) |
| 682 | } |
| 683 | |
| 684 | func lastIndexOfOffset(str, substr string, offset int64) (int64, error) { |
| 685 | off := int(offset) |
no test coverage detected