xiaozi 2022-08-16 16:14:06

删除字符串中的BOM

javascript javascript
function trimBOM(str) {
  // remove BOM if present
  if (str.charCodeAt(0) === 0xfeff) {
    str = str.substr(1);
  }
  return str;
}

评论

首页 - Wiki
Copyright © 2011-2025 iteam. Current version is 2.139.1. UTC+08:00, 2025-01-15 20:48
浙ICP备14020137号-1 $访客地图$