tryFromOctal function

Uint8List? tryFromOctal(
  1. String input, {
  2. Base8Codec codec = Base8Codec.standard,
})

Converts a Base-8 string to an 8-bit integer sequence, returning null instead of throwing when the input is not valid.

This is the non-throwing counterpart of fromOctal. See fromOctal for the meaning of codec.

Implementation

Uint8List? tryFromOctal(
  String input, {
  Base8Codec codec = Base8Codec.standard,
}) {
  try {
    return fromOctal(input, codec: codec);
  } on FormatException {
    return null;
  }
}