# isDivisibleBy method

bool isDivisibleBy(

1. Object n

)

Check if the string is a number that's divisible by another

`n` is a String or an int.

## Implementation

    bool isDivisibleBy(Object n) {
      assert(n is String || n is int);
      final int? number;
      if (n is int) {
        number = n;
      } else if (n is String) {
        number = int.tryParse(n);
      } else {
        return false;
      }
      if (number == null) return false;
      try {
        return double.parse(this) % number == 0;
      } catch (e) {
        return false;
      }
    }