Package com.google.common.base

Examples of com.google.common.base.CharMatcher$Or


       * The name must be a valid DNS name. From wikipedia: "The characters allowed in a label are a
       * subset of the ASCII character set, a and includes the characters a through z, A through Z,
       * digits 0 through 9". From Azure: Every Dash (-) Must Be Immediately Preceded and Followed
       * by a Letter or Number.
       */
      CharMatcher range = getAcceptableRange();
      if (!range.matchesAllOf(name))
         throw exception(name, "Should have lowercase ASCII letters, " + "numbers, or dashes");
   }
View Full Code Here


    }

    @Test
    public void whenRemoveSpecialCharacters_thenRemoved() {
        final String input = "H*el.lo,}12";
        final CharMatcher matcher = CharMatcher.JAVA_LETTER_OR_DIGIT;
        final String result = matcher.retainFrom(input);

        assertEquals("Hello12", result);
    }
View Full Code Here

* Date: 7/03/2014
* Time: 8:55 AM
*/
public class OptionsSplitter {
    public List<String> split(String chromeSwitches) {
        CharMatcher trimmable = CharMatcher.anyOf(" ,;");
        Splitter.on("--").trimResults().split(chromeSwitches);
        List<String> options = Lists.newArrayList(Splitter.on("--").omitEmptyStrings().trimResults(trimmable).split(chromeSwitches));
        return convert(options, withPrefixes());
    }
View Full Code Here

TOP

Related Classes of com.google.common.base.CharMatcher$Or

Copyright © 2018 www.massapicom. 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.