Anonymer Benutzer
Modul:String: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
per edit request (permalink);
K (1 Version importiert) |
Modul>Trappist the monk (per edit request (permalink);) |
||
| Zeile 59: | Zeile 59: | ||
Parameters | Parameters | ||
s: The string to return a subset of | s: The string to return a subset of | ||
i: The | i: The first index of the substring to return, defaults to 1. | ||
j: The last index of the string to return, defaults to the last character. | j: The last index of the string to return, defaults to the last character. | ||
| Zeile 407: | Zeile 407: | ||
if plain then | if plain then | ||
pattern = str._escapePattern( pattern ) | pattern = str._escapePattern( pattern ) | ||
replace = | replace = string.gsub( replace, "%%", "%%%%" ) --Only need to escape replacement sequences. | ||
end | end | ||
| Zeile 583: | Zeile 583: | ||
]] | ]] | ||
function str._escapePattern( pattern_str ) | function str._escapePattern( pattern_str ) | ||
return | return ( string.gsub( pattern_str, "[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%0" ) ) | ||
end | end | ||
return str | return str | ||