whenEmpty method

String whenEmpty(
  1. String defaultValue
)

为空字符串增加默认值

Implementation

String whenEmpty(String defaultValue) {
  return isNotEmpty ? this : defaultValue;
}