// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) deadcode 
// Source File Name:   StringUtils.java

package com.symantec.itools.lang;

import java.io.PrintStream;

// Referenced classes of package com.symantec.itools.lang:
//            IllegalInstantiationError

public class StringUtils
{

    protected StringUtils()
    {
        throw new IllegalInstantiationError(com.symantec.itools.lang.StringUtils.class);
    }

    public static int compareToIgnoreCase(String s, String s1)
    {
        return s.toLowerCase().compareTo(s1.toLowerCase());
    }

    public static boolean endsWithIgnoreCase(String s, String s1)
    {
        return s.toLowerCase().endsWith(s1.toLowerCase());
    }

    public static int indexOfIgnoreCase(String s, int i)
    {
        return s.toLowerCase().indexOf(Character.toLowerCase((char)i));
    }

    public static int indexOfIgnoreCase(String s, int i, int j)
    {
        return s.toLowerCase().indexOf(Character.toLowerCase((char)i), j);
    }

    public static int indexOfIgnoreCase(String s, String s1)
    {
        return s.toLowerCase().indexOf(s1.toLowerCase());
    }

    public static int indexOfIgnoreCase(String s, String s1, int i)
    {
        return s.toLowerCase().indexOf(s1.toLowerCase(), i);
    }

    public static int lastIndexOfIgnoreCase(String s, int i)
    {
        return s.toLowerCase().lastIndexOf(Character.toLowerCase((char)i));
    }

    public static int lastIndexOfIgnoreCase(String s, int i, int j)
    {
        return s.toLowerCase().lastIndexOf(Character.toLowerCase((char)i), j);
    }

    public static int lastIndexOfIgnoreCase(String s, String s1)
    {
        return s.toLowerCase().lastIndexOf(s1.toLowerCase());
    }

    public static int lastIndexOfIgnoreCase(String s, String s1, int i)
    {
        return s.toLowerCase().lastIndexOf(s1.toLowerCase(), i);
    }

    public static int occurencesOf(String s, char c)
    {
        char ac[] = new char[s.length()];
        s.getChars(0, ac.length, ac, 0);
        int i = 0;
        for(int j = 0; j < ac.length; j++)
            if(ac[j] == c)
                i++;

        return i;
    }

    public static int occurencesOfIgnoreCase(String s, char c)
    {
        return occurencesOf(s.toLowerCase(), Character.toLowerCase(c));
    }

    public static String replace(String s, String s1, String s2)
    {
        int i = s2.length();
        int j = s.indexOf(s1);
        int k = j;
        int l;
        for(; j > -1; j = s.indexOf(s1, l))
        {
            String s3 = s.substring(0, j);
            String s4 = s.substring(j + s1.length(), s.length());
            s = s3 + s2 + s4;
            l = j + i;
        }

        return s;
    }

    public static String replaceIgnoreCase(String s, String s1, String s2)
    {
        String s3 = s.toLowerCase();
        int i = s2.length();
        int j = s3.indexOf(s1);
        int k = j;
        int l;
        for(; j > -1; j = s3.indexOf(s1, l))
        {
            String s4 = s.substring(0, j);
            String s5 = s.substring(j + s1.length(), s.length());
            s = s4 + s2 + s5;
            l = j + i;
        }

        return s;
    }

    public static boolean startsWithIgnoreCase(String s, String s1)
    {
        return s.toLowerCase().startsWith(s1.toLowerCase());
    }

    public static boolean startsWithIgnoreCase(String s, String s1, int i)
    {
        return s.toLowerCase().startsWith(s1.toLowerCase(), i);
    }

    public static void main(String args[])
    {
        System.out.println(replaceIgnoreCase(args[0], args[1], args[2]));
    }
}
