DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR TYPESCRIPT
How to return a new string with its first and last characters swapped
>>> temp = "abcde" >>> temp[1:-1] 'bcd' >>> temp[-1:] + temp[1:-1] + temp[:1] 'ebcda' >>>
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#How
#return
#string
#characters
#swapped
ADD COMMENT
Topic
COMMENT
Name
3+4 =
Submit