bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] Why the length(seps) is one more than the return value of pat


From: Peng Yu
Subject: [bug-gawk] Why the length(seps) is one more than the return value of patsplit()?
Date: Sun, 8 Mar 2015 00:26:47 -0600

Hi,

The following code shows that the length(seps) is one more than the
return value of patsplit(). I thought that seps should have the same
as the number of elements in "a". Why it is not the case? Could
anybody help me understand this? Thanks.

~$ awk 'BEGIN { print patsplit("aAbBcC", a, /[a-z]/, seps); print
seps[1], seps[2], seps[3], length(seps); }'
3
A B C 4

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]