v2 / vlib / v / util / util.js.v
15 lines · 13 sloc · 341 bytes · 0da7e2f8ab7b8a505deaa041ef805931603d978d
Raw
1module util
2
3pub fn skip_bom(file_content string) string {
4 mut raw_text := file_content
5 if raw_text.len >= 3 {
6 js_text := raw_text.str
7 _ := js_text
8 #if (js_text.charCodeAt(0) == 0xEF && js_text.charCodeAt(1) == 0xBB && js_text.charCodeAt(2) == 0xBF)
9
10 {
11 #raw_text.str = js_text.slice(3,js_text.length);
12 }
13 }
14 return raw_text
15}
16