Difference between revisions of "Module:String"

Jump to navigation Jump to search
6 bytes added ,  15:30, 24 February 2013
replace_plain fix
>WOSlinker
(add str.replace_plain)
>WOSlinker
(replace_plain fix)
Line 175: Line 175:
     local pattern_plain = mw.ustring.gsub(pattern, '%%', '%%%%');
     local pattern_plain = mw.ustring.gsub(pattern, '%%', '%%%%');
     local replace_plain = mw.ustring.gsub(replace, '%%', '%%%%');
     local replace_plain = mw.ustring.gsub(replace, '%%', '%%%%');
    local result;


     if firstonly == 'true' or firstonly == 'yes' or firstonly == '1' then
     if firstonly == 'true' or firstonly == 'yes' or firstonly == '1' then
         local result = mw.ustring.gsub( source_str, pattern_plain, replace_plain, 1 );
         result = mw.ustring.gsub( source_str, pattern_plain, replace_plain, 1 );
     else
     else
         local result = mw.ustring.gsub( source_str, pattern_plain, replace_plain, n );
         result = mw.ustring.gsub( source_str, pattern_plain, replace_plain, n );
     end
     end


Anonymous user

Navigation menu