Package java.lang

Examples of java.lang.String.indexOf()


                if (i == 0)
                    elem = " " + elem.substring (2);
                else
                    elem = elem.substring (0, i) + " " + elem.substring (i+2);
                changed = true;
                i = elem.indexOf (LTB);
            }
            int lsIncr = lineSeparator.length () - 1;
            for (i=0; i<elem.length (); i++) {
                if (elem.charAt (i) == NL) {
                    elem = elem.substring (0, i) +
View Full Code Here


    public static final String msg (String msgkey, String parm) {

        if (loadNeeded)
            loadDefaultProperties ();
        String msgtext = m.getProperty (msgkey, msgkey);
        int i = msgtext.indexOf ("%1");
        if (i >= 0) {
            String ending = "";
            if ((i+2) < msgtext.length ())
                ending = msgtext.substring (i+2);
            return msgtext.substring (0, i) + parm + ending;
View Full Code Here

            if (serverName.startsWith("http://")) {
                serverName = serverName.substring("http://".length());
            } else if (serverName.startsWith("https://")) {
                serverName = serverName.substring("https://".length());
            }
            int index = serverName.indexOf(':');
            if (index != -1) {
                setProxyName(serverName.substring(0, index).trim());
                String serverPort = serverName.substring(index+1).trim();
                if (serverPort.length() > 0) {
                    try {
View Full Code Here

        }

        String contentType = getContentType();
        if (contentType == null)
            contentType = "";
        int semicolon = contentType.indexOf(';');
        if (semicolon >= 0) {
            contentType = contentType.substring(0, semicolon).trim();
        } else {
            contentType = contentType.trim();
        }
View Full Code Here

      // enable indentation use
      final String origBadSentence = origBadExample.getExample().replaceAll(
          "[\\n\\t]+", "");
      final List<String> suggestedCorrections = origBadExample
          .getCorrections();
      final int expectedMatchStart = origBadSentence.indexOf("<marker>");
      final int expectedMatchEnd = origBadSentence.indexOf("</marker>")
          - "<marker>".length();
      if (expectedMatchStart == -1 || expectedMatchEnd == -1) {
        fail(lang
            + ": No error position markup ('<marker>...</marker>') in bad example in rule " + rule);
View Full Code Here

      final String origBadSentence = origBadExample.getExample().replaceAll(
          "[\\n\\t]+", "");
      final List<String> suggestedCorrections = origBadExample
          .getCorrections();
      final int expectedMatchStart = origBadSentence.indexOf("<marker>");
      final int expectedMatchEnd = origBadSentence.indexOf("</marker>")
          - "<marker>".length();
      if (expectedMatchStart == -1 || expectedMatchEnd == -1) {
        fail(lang
            + ": No error position markup ('<marker>...</marker>') in bad example in rule " + rule);
      }
View Full Code Here

        }

        String contentType = getContentType();
        if (contentType == null)
            contentType = "";
        int semicolon = contentType.indexOf(';');
        if (semicolon >= 0) {
            contentType = contentType.substring(0, semicolon).trim();
        } else {
            contentType = contentType.trim();
        }
View Full Code Here

            if (serverName.startsWith("http://")) {
                serverName = serverName.substring("http://".length());
            } else if (serverName.startsWith("https://")) {
                serverName = serverName.substring("https://".length());
            }
            int index = serverName.indexOf(':');
            if (index != -1) {
                setProxyName(serverName.substring(0, index).trim());
                String serverPort = serverName.substring(index+1).trim();
                if (serverPort.length() > 0) {
                    try {
View Full Code Here

            if (serverName.startsWith("http://")) {
                serverName = serverName.substring("http://".length());
            } else if (serverName.startsWith("https://")) {
                serverName = serverName.substring("https://".length());
            }
            int index = serverName.indexOf(':');
            if (index != -1) {
                setProxyName(serverName.substring(0, index).trim());
                String serverPort = serverName.substring(index+1).trim();
                if (serverPort.length() > 0) {
                    try {
View Full Code Here

        }

        String contentType = getContentType();
        if (contentType == null)
            contentType = "";
        int semicolon = contentType.indexOf(';');
        if (semicolon >= 0) {
            contentType = contentType.substring(0, semicolon).trim();
        } else {
            contentType = contentType.trim();
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.