toIntOrNull method

int? toIntOrNull()

convert String to int if is possible else will return null

Implementation

int? toIntOrNull() => int.tryParse(this);