substringBetween method

String substringBetween(
  1. String left, {
  2. required String and,
})

Implementation

String substringBetween(String left, {required String and}) {
  final leftIndex = indexOf(left);
  final rightIndex = lastIndexOf(and);
  try {
    return substring(leftIndex + 1, rightIndex);
  } catch (e) {
    L.w('substringBetween过程出错, 要检查一下是否业务逻辑是否有问题!');
    return '';
  }
}