toBytes method

List<int> toBytes()

Convert string to bytes.

Implementation

List<int> toBytes() {
  if (this == null) {
    throw ArgumentError('string: $this');
  }
  return utf8.encode(this!);
}