lua-users home
lua-l archive

Re: Finding end of string

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 10/12/2017 07:56 PM, Egor Skriptunoff wrote:
> function end_of_string_literal (text, start_pos, quote)
> return text:gsub("\\?.", {[quote]="0円"}):match("%z()", start_pos)
> end
> 
> print(end_of_string_literal ([[a="\"A",b="\\\"B\"",c="C"]], 4, '"')) --> 8
> print(end_of_string_literal ([[a="\"A",b="\\\"B\"",c="C"]], 12, '"')) --> 20
> print(end_of_string_literal ([[a="\"A",b="\\\"B\"",c="C"]], 24, '"')) --> 26
What task this code solves?
-- Martin

AltStyle によって変換されたページ (->オリジナル) /