মডিউল:String: সংশোধিত সংস্করণের মধ্যে পার্থক্য
অ
1 revision imported
Nazarzadeh (আলোচনা | অবদান) অ (১টি সংস্করণ আমদানি করা হয়েছে) |
অ (1 revision imported) |
||
৫৯ নং লাইন: | ৫৯ নং লাইন: | ||
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. | ||
৪০৭ নং লাইন: | ৪০৭ নং লাইন: | ||
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 | ||
৫৮৩ নং লাইন: | ৫৮৩ নং লাইন: | ||
]] | ]] | ||
function str._escapePattern( pattern_str ) | function str._escapePattern( pattern_str ) | ||
return | return ( string.gsub( pattern_str, "[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%0" ) ) | ||
end | end | ||
return str | return str |