in reply to RE: RE: Trying to make a search
in thread Trying to make a search
Perhaps it is a bleed-over of Perl's DWIM concept. It seems logical (to me, at least) that if the user inputs a string rather than a single character the program should return all lines beginning with that string. But then I imagine it is just as logical to you that the program should only use the first character as the search prefix.
In legitimate production code where we are concerned about how many characters the user inputs, it would probably be better to allow only one character--rather than an entire line--to be input in the first place (don't want to confuse those end-users). And since the OP does say 'letter', we'd also reject any input that isn't one.
|
|---|