Ad
Strings
Data Types

Last Character of a string in JS.

Code
Diff
  • const lastChar=(s)=>s.slice(-1)
    
    • def last_char(str):
    • return str[-1]
    • const lastChar=(s)=>s.slice(-1)