Help for this page

Select Code to Download


  1. or download this
    my $string = "Here is our test string.";
    my $word;
    ( $word, $string ) = split /^(\w+)\b/, $string, 2;
    
  2. or download this
    $string = $word . $string;
    
  3. or download this
    my $string = "This is the test string.";
    my $word;
    ( $word, $string ) = $string =~ m/^(\w+)\b(.*)/;
    
  4. or download this
    my $string = "Here is our test string.";
    my $word = $string =~ s/^(\w+)\b(.*)/$2/;
    
  5. or download this
    $string = $word . $string;