    001package net.minecraft.util;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.util.regex.Pattern;
    006
    007public class StringUtils
    008{
    009    private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
    010
    011    @SideOnly(Side.CLIENT)
    012
    013    /**
    014     * Returns the time elapsed for the given number of ticks, in "mm:ss" format.
    015     */
    016    public static String ticksToElapsedTime(int par0)
    017    {
    018        int j = par0 / 20;
    019        int k = j / 60;
    020        j %= 60;
    021        return j < 10 ? k + ":0" + j : k + ":" + j;
    022    }
    023
    024    public static String stripControlCodes(String par0Str)
    025    {
    026        return patternControlCode.matcher(par0Str).replaceAll("");
    027    }
    028}