in reply to substr question
$s = "I want to only show the first 100 characters or so of a string +that has more than 100, but I don't want to split it in the middle of + a word, so is there a way to do it instead of this:";; print $string =~ m[(^.{0,100})\s];; I want to only show the first 100 characters or so of a string that ha +s more than 100, but I don't print $s =~ m[(^.{0,$_})\s] for 20 .. 50;; I want to only show I want to only show I want to only show I want to only show the I want to only show the I want to only show the I want to only show the I want to only show the I want to only show the I want to only show the first I want to only show the first I want to only show the first I want to only show the first I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 I want to only show the first 100 characters I want to only show the first 100 characters I want to only show the first 100 characters I want to only show the first 100 characters or I want to only show the first 100 characters or I want to only show the first 100 characters or I want to only show the first 100 characters or so
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: substr question
by ikegami (Patriarch) on Jun 18, 2010 at 17:15 UTC |