Let’s continue working on our
str_ends_with() utility function in this episode. We’ll explore the second implementation which uses the same strategy as we used in “starts with”.
There is a functional difference between searching a string for its position and returning a substring from it. In this episode, you’ll implement a solution that uses
mb_substr. Then we’ll break it down and discuss how each processes and why this implementation is a better solution.
Whoever says that coding is hard, just smack them.
Total Lab Runtime: 01:58:54
- 1 Lab Introductionfree 03:24
- 2 Checking if String Starts With a Character or Substringpro 13:43
- 3 Explaining the "String Starts With" Strategypro 13:35
- 4 Check if String Ends With a Character or Substring - Part 1pro 15:11
- 5 Check if String Ends With a Character or Substring - Part 2pro 12:52
- 6 Has Substringpro 04:27
- 7 Truncate by Characterspro 17:18
- 8 Truncate by Wordspro 14:35
- 9 Converting to Lowercasepro 07:58
- 10 Converting to Uppercasepro 01:30
- 11 Splitting a String into An Arraypro 07:17
- 12 Joining Array Elements into a Stringpro 03:43
- 13 Wrap it Uppro 03:21