    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import java.util.regex.Pattern;
    006
    007    public 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    }