reverse srring in dart
import 'dart:io';
void main() {
stdout.write("Please give a word: ");
String input = stdin.readLineSync().toLowerCase();
String revInput = input.split('').reversed.join('');
}
reverse srring in dart
import 'dart:io';
void main() {
stdout.write("Please give a word: ");
String input = stdin.readLineSync().toLowerCase();
String revInput = input.split('').reversed.join('');
}
dart reverse a string
// Library approach
String solution1(str) {
return str.split('').reversed.join('');
}
// With runes
String solution(String str) => str.runes.toList().reversed.map((e) => String.fromCharCode(e)).join('');
// DIY approach
String solution(str) {
String reversed = "";
for(var i =str.length-1; i>=0; i--)
reversed+=str[i];
return reversed;
}
srring reverse dart
string.split('').reversed.join('');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us