source: trunk/essentials/sys-apps/gawk/test/substr.awk

Last change on this file was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 334 bytes
Line 
1BEGIN {
2 x = "A"
3 printf("%-39s\n", substr(x,1,39))
4 print substr("abcdef", 0, 2)
5 print substr("abcdef", 2.3, 2)
6 print substr("abcdef", -1, 2)
7 print substr("abcdef", 1, 0)
8 print substr("abcdef", 1, -3)
9 print substr("abcdef", 1, 2.3)
10 print substr("", 1, 2)
11 print substr("abcdef", 5, 5)
12 print substr("abcdef", 7, 2)
13 exit (0)
14}
Note: See TracBrowser for help on using the repository browser.