Logo

Programming-Idioms

History of Idiom 41 > diff from v41 to v42

Edit summary for version 42 by Ed:
New Dart implementation by user [Ed]

Version 41

2018-01-04, 00:00:29

Version 42

2018-01-17, 15:41:02

Idiom #41 Reverse a string

Create string t containing the same characters as string s, in reverse order.
Original string s must remain unaltered. Each character must be handled correctly regardless its number of bytes in memory.

Illustration

Idiom #41 Reverse a string

Create string t containing the same characters as string s, in reverse order.
Original string s must remain unaltered. Each character must be handled correctly regardless its number of bytes in memory.

Illustration
Code
var t = s.split('').reversed.join();