removeUrlProtocol method

String removeUrlProtocol()

移除 URL 协议(http:// / https://)。null / 空串返回 ''。

Implementation

String removeUrlProtocol() {
  final s = this;
  if (s == null || s.isEmpty) return s ?? '';
  return s.replaceFirst(RegExp(r'https?:\/\/'), '');
}