Java String Starts Wtih startsWithCommonPackagePrefix(String inputText)

Here you can find the source of startsWithCommonPackagePrefix(String inputText)

Description

starts With Common Package Prefix

License

Apache License

Declaration

public static boolean startsWithCommonPackagePrefix(String inputText) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static boolean startsWithCommonPackagePrefix(String inputText) {
        return startsWithPrefix(inputText, new String[] { "java.", "javax.", "com.", "net.", "org." });
    }/*from   w ww. ja va2  s  .  c  om*/

    public static boolean startsWithPrefix(String inputText, String[] prefixes) {
        for (int i = 0; i < prefixes.length; i++) {
            if (inputText.startsWith(prefixes[i])) {
                return true;
            }
        }
        return false;
    }
}

Related

  1. startsWithChar(String s, char c)
  2. startsWithChar(String string, char prefix)
  3. startsWithChar(String string, int character)
  4. startsWithCharacter(String str, char stringStart)
  5. startsWithCharacter(String str, String matchChars)
  6. startsWithConcatenation(String string, String... prefixes)
  7. startsWithConcatenationOf(String testee, String firstPrefix, String secondPrefix)
  8. startsWithCS(String a, String b)
  9. startsWithDigitsFollowedByLetters(String str)