Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static final String VALID_BATTLETAG_PATTERN_POUND = "(\\w+)#(\\d{4})";

    public static String formatBattletagForWebService(String battletag) {
        if (battletag.matches(VALID_BATTLETAG_PATTERN_POUND)) {
            battletag = battletag.replaceFirst("#", "-");
        }

        return battletag;
    }
}