Advertisement
Hiteshw11

Write a function that reverses a given string.

Nov 17th, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.20 KB | Source Code | 0 0
  1. // Write a function that reverses a given string.
  2.  
  3. void main()
  4. {
  5.   String abc='hitesh';
  6.   List<String> def=abc.split('').toList();
  7.   List<String> name=def.reversed.toList();
  8.   print(name.join());
  9. }
Tags: dart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement