secondWord method

String? secondWord()

Returns the second word of this string.

Implementation

String? secondWord() {
  if (isEmpty) return null;
  final List<String>? wordList = words();
  if (wordList == null || wordList.length < 2) return null;
  return wordList[1];
}