7 kyu

String ends with?

93,949 of 251,130jhoffner

Description:

Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string).

Examples:

solution('abc', 'bc') // returns true
solution('abc', 'd') // returns false
solution('abc', 'bc') # returns true
solution('abc', 'd') # returns false
solution('abc', 'bc') # returns true
solution('abc', 'd') # returns false
solution("abc", "bc") // returns true
solution("abc", "d") // returns false
solution("abc", "bc"). % match
\+ solution("abc", "d"). % no match
(solution "abc" "bc") ; returns true
(solution "abc" "d'" ; returns false
strEndsWith('abc', 'bc') -- returns true
strEndsWith('abc', 'd') -- returns false
      StringEndsWith('abc', 'bc')
      *     -->      result = 1
      StringEndsWith('abc', 'd')
      *     -->      result = 0
solution("abc", "bc") // returns true
solution("abc", "d") //returns false
Strings
Fundamentals

More By Author:

Check out these other kata created by jhoffner

Stats:

CreatedJul 26, 2013
PublishedJul 26, 2013
Warriors Trained407656
Total Skips30282
Total Code Submissions791796
Total Times Completed251130
JavaScript Completions93949
CoffeeScript Completions716
Python Completions76719
Ruby Completions3623
C# Completions13022
C Completions6348
Elixir Completions864
Rust Completions4466
Java Completions26157
TypeScript Completions7912
C++ Completions10843
Haskell Completions1231
PHP Completions4972
Crystal Completions47
Go Completions5742
Prolog Completions75
Clojure Completions401
Lua Completions454
COBOL Completions28
D Completions21
Scala Completions195
Total Stars1715
% of votes with a positive feedback rating87% of 15046
Total "Very Satisfied" Votes11717
Total "Somewhat Satisfied" Votes2793
Total "Not Satisfied" Votes536
Ad
Contributors
  • jhoffner Avatar
  • victorkohl Avatar
  • nuscheltier Avatar
  • Bitman Avatar
  • Unnamed Avatar
  • siebenschlaefer Avatar
  • SpaceBison Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • B1ts Avatar
  • davejones Avatar
  • a.merezhanyi Avatar
  • Voile Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • rsa Avatar
  • monadius Avatar
  • hobovsky Avatar
  • rabbit_binary7 Avatar
  • user8436785 Avatar
  • USK Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • Just4FunCoder Avatar
  • ethan67 Avatar
  • KayleighWasTaken Avatar
Ad