Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 128: Working With Strings - Part 1
Implement `truncate(s, n)` returning `s` unchanged if its length is at most `n`, otherwise the first `n` characters followed by three dots.
+ 1 hidden test run on Submit.
Only strings longer than n are cut to n characters with an ellipsis appended.
Run your code to see results.