A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Palindromic Number in Dart page! Here, you'll find the source code for this program as well as a description of how the program works.
//Issue 4971
void main(List<String> args){
const String error_message= "Usage: please input a non-negative integer";
if (args.isEmpty){
print(error_message);
return;
}
try{
bool is_palindrome = true;
int num_needed = int.parse(args[0]);
if (num_needed.isNegative){
print(error_message);
return;
}
String original_string = num_needed.toString();
String reverse_string = original_string.split('').reversed.join('') ;
is_palindrome = (original_string == reverse_string);
print(is_palindrome);
}
catch(e){
print(error_message);
}
}
Palindromic Number in Dart was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.