Palindromic Number in Dart

Published on 04 October 2025 (Updated: 04 October 2025)

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.

Current Solution

//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.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.