# set terminal pngcairo background "#ffffff" enhanced font "arial,10" fontscale 1.0 size 600, 400 # set output 'stringvar.2.png' set label 1 "Exercise string handling functions\n\nfoo = ABCDEF\nstrlen(foo) = 6\nsubstr(foo,3,4) = CD\n\nhaystack = `date`\nhaystack = Sat Nov 17 13:04:59 PST 2012\nneedle = :\nS = strstrt(haystack,needle) = 14\nhaystack[S-2:S+2] = 13:04\nIt is now 13:04\n\nwords(haystack) = 6\nword(haystack,5) = PST\n\nsprintf output of long strings works OK\n" at graph 0.1, 0.9, 0 left norotate back nopoint offset character 0, 0, 0 set style data lines set noxtics set noytics set yrange [ 0.00000 : 1.00000 ] noreverse nowriteback beg = 2 end = 4 foo = " 1 2 3 4 5 6" ERRNO = 0 haystack = "Sat Nov 17 13:04:59 PST 2012" needle = ":" S = 14 plot 0