Print last character of string

Beginner Problems Language Basics Easy

Given a string s. Return the last character of the given string s.

Examples:

Input : s = "takeuforward"

Output : d

Explanation : The last character of given string is "d".

Input : s = "goodforyou"

Output : u

Explanation : The last character of given string is "u".

Input : s = "lovecoding"

Constraints

  • 1 <= s.length <= 100
  • s consist of only lowercase English letters

Company Tags

TCS Cognizant Accenture Infosys Capgemini Wipro IBM HCL Tech Mahindra MindTree