Does Ruby have a some_string.starts_with("abc") method that’s built in?
Does Ruby have a some_string.starts_with(abc) method that’s built in?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s called
String#start_with?, notString#startswith: In Ruby, the names of boolean-ish methods end with?and the words in method names are separated with an_. On Rails you can use the aliasString#starts_with?(note the plural – and note that this method is deprecated). Personally, I’d preferString#starts_with?over the actualString#start_with?