Po redaktohet
Moduli:string/gline
Kërceni tek navigimi
Kërceni tek kërkimi
Kujdes:
S’jeni i regjistruar. Adresa juaj IP do të jetë e dukshme publikisht, nëse bëni ndonjë redaktim. Nëse
hyni
ose
krijoni një llogari
, përveç përfitimesh të tjera, redaktimet tuaja do t’i atribuohen emrit tuaj të përdoruesit.
Kontrolli anti-spam.
Mos
e plotëso këtë!
local error = error local find = string.find local gmatch = string.gmatch local match = string.match local sub = string.sub --[==[ Iterates over the lines in a string, treating {"\n"}, {"\r"} and {"\r\n"} as new lines. The optional {skip} parameter determines whether certain lines are skipped: * {NONE}: none (default). * {EMPTY}: empty lines: lines with a length of 0, consisting of no characters. * {BLANK}: blank lines: empty lines and lines which only consist of whitespace characters.]==] return function(str, skip) -- Use gmatch() for EMPTY and BLANK, for speed. if skip == "EMPTY" then return gmatch(str, "[^\n\r]+") elseif skip == "BLANK" then return gmatch(str, "[^\n\r]-%S[^\n\r]*") elseif not (skip == nil or skip == "NONE") then error("bad argument #2 to 'string/gline' (expected NONE, EMPTY or BLANK)", 2) end local start, linechar, flag = 1 if not find(str, "\n", nil, true) then if not find(str, "\r", nil, true) then -- No newlines: return `str` on the first iteration then end. return function() if flag then return end flag = true return str end end linechar = "\r" elseif find(str, "\r", nil, true) then -- Newline could be "\n", "\r" or "\r\n" (but not "\n\r"). return function() if not flag then local line, nl, pos = match(str, "^([^\n\r]*)([\n\r]\n?)()", start) if not line then flag = true return sub(str, start) end -- If `nl` is "\r\n" it should be treated as a single newline, -- but if it's "\n\n" it needs to be treated as two separate -- newlines, so set `flag` to 2 to avoid an unnecessary match() -- call on the next iteration. if nl == "\n\n" then flag = 2 end start = pos return line elseif flag == 2 then flag = nil return "" end end else linechar = "\n" end -- Newline is either "\n" or "\r", depending on which has been found. return function() if flag then return end local pos = find(str, linechar, start, true) if not pos then flag = true return sub(str, start) end local line = sub(str, start, pos - 1) start = pos + 1 return line end end
Përmbledhje:
Ju lutemi, vini re! Të gjitha kontributet në Enciklopedi Puro Shqiptare jepen për publikim sipas Creative Commons Attribution (shiko
Project:Të drejtat e autorit
për më shumë detaje). Nëse ju nuk dëshironi që shkrimet tuaja të redaktohen pa mëshirë dhe të shpërndahen sipas dëshirës, atëherë mos i vendosni këtu.
Gjithashtu, ju po na premtoni ne që gjithçka e keni shkruar vetë, ose e keni kopjuar nga një domain publik ose nga burime të tjera te hapura.
Mos vendosni material të mbrojtur nga e drejta e autorit pa leje!
Anuloje
Ndihmë për redaktim
(hapet në një dritare të re)
Stamp të përdorura në këtë faqe:
Moduli:string/gline/doc
(
redakto
)
Menu lëvizjesh
Mjetet e mia
Nuk keni hyrë brenda
Diskutimi
Kontribute
Krijo llogari
Hyni
Emërhapësira
Moduli
Diskutim
English
Shikime
Lexo
Përpunoni burim
Shihni historikun
Më shumë
Kërko
Lëvizje
Faqja kryesore
Ndryshimet e fundit
Faqe e rastit
Ndihmë rreth MediaWiki-t
Faqet e veçanta
Mjete
Lidhjet këtu
Ndryshime të ndërvarura
Informacioni i faqes