Logo

Programming-Idioms

History of Idiom 41 > diff from v42 to v43

Edit summary for version 43 by Edward E.:
[Dart] username corrected

Version 42

2018-01-17, 15:41:02

Version 43

2018-01-17, 15:42:12

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();

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