Rubified first_sentence method.
Using \A and \Z is more clear, as these match the beginning and end of string, while ^ and $ match beginning and end of line. Removed unneeded variable. Added rspec to make sure it all works as intended.
Loading
Please register or sign in to comment