public class TextKit extends Object
| Constructor and Description |
|---|
TextKit() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertContainsTextSequence(String srcText,
String[] expectedTextSequence)
Returns true if the given expectedTextSequence of Strings all occur within the given srcText in the order given.
|
static String |
collapseWhitespace(String text)
Collapses repeated white space ( \n\t) in the string into a single space.
|
static boolean |
containsCollapseWhiteSpace(String needle,
String haystack)
Tests if two strings are equal after repeated white space sequences
are collapased into single spaces.
|
static boolean |
containsTextSequence(String srcText,
String[] expectedTextSequence)
Returns true if the 'srcText' contains the given sequence of text.
|
static boolean |
equalsCollapseWhiteSpace(String string1,
String string2)
Tests if two strings are equal after repeated white space sequences
are collapased into single spaces.
|
static int |
getNumOccurences(String text,
String subString)
Counts the number of times that subString occurs within the given text.
|
static String |
htmlEncode(String text) |
public static String collapseWhitespace(String text)
text - the text to collapse the white space inpublic static boolean equalsCollapseWhiteSpace(String string1, String string2)
string1 - the first string to teststring2 - the second string to testcollapseWhitespace(java.lang.String)public static boolean containsCollapseWhiteSpace(String needle, String haystack)
needle - the first string to testhaystack - the second string to testcollapseWhitespace(java.lang.String)public static int getNumOccurences(String text, String subString)
text - The text to search.subString - The subString that we are searching for.public static boolean containsTextSequence(String srcText, String[] expectedTextSequence)
srcText - the text to searchexpectedTextSequence - the expected text sequencepublic static void assertContainsTextSequence(String srcText, String[] expectedTextSequence)
srcText - the text to searchexpectedTextSequence - the expected text sequenceCopyright © 2002-2017 Atlassian. All Rights Reserved.