Re: Finding end of string
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Finding end of string
- From: Martin <eden_martin_fuhrspam@...>
- Date: 2017年10月12日 20:16:01 +0100
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