Help for this page

Select Code to Download


  1. or download this
    split(/\n/,   "hello\nworld")  ->  ("hello", "world")
    split(/(\n)/, "hello\nworld")  ->  ("hello", "\n", "world")
    
  2. or download this
    $text = join '',
            grep $_ ne "$word\n",
            split /(?<=\n)/,
            $text;