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 setDeviceName(String inDeviceName) {
        try {
            if (null != inDeviceName && !"".equals(inDeviceName) && inDeviceName.contains("#")) {
                return inDeviceName.substring(0, inDeviceName.indexOf("#"));
            } else {
                return inDeviceName;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return inDeviceName;
    }
}