Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String removeBom(String str) {

        byte[] isBom = str.substring(0, 1).getBytes();
        if (isBom.length == 3 && isBom[0] == (byte) 0xEF && isBom[1] == (byte) 0xBB && isBom[2] == (byte) 0xBF) {
            return str.substring(1);
        }

        return str;
    }
}