    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 var1 = par0 / 20;
    019        int var2 = var1 / 60;
    020        var1 %= 60;
    021        return var1 < 10 ? var2 + ":0" + var1 : var2 + ":" + var1;
    022    }
    023
    024    public static String stripControlCodes(String par0Str)
    025    {
    026        return patternControlCode.matcher(par0Str).replaceAll("");
    027    }
    028}