License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

  • org.joget.commons.util.StringUtil
  • Under wflow-commons module
  • Utility methods for String processing

Code Sample

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

import org.joget.commons.util.StringUtil;
 
String html = "<p>This is a test string</p>";
String stripped = StringUtil.stripAllHtmlTag(html);

Fields

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_HTML
public static final java.lang.String TYPE_HTML = "html";

Used for escapeString method for escape format to escape html syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_JAVA
public static final java.lang.String TYPE_JAVA = "java";

Used for escapeString method for escape format to escape java syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_JAVASCIPT
public static final java.lang.String TYPE_JAVASCIPT = "javascript";

Used for escapeString method for escape format to escape javascript syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_JSON
public static final java.lang.String TYPE_JSON = "json";

Used for escapeString method for escape format to escape json syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_REGEX
public static final java.lang.String TYPE_REGEX = "regex";

Used for escapeString method for escape format to escape regex syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_SQL
public static final java.lang.String TYPE_SQL = "sql";

Used for escapeString method for escape format to escape sql syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_URL
public static final java.lang.String TYPE_URL = "url";

Used for escapeString method for escape format to encode url parameter value.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

TYPE_XML
public static final java.lang.String TYPE_XML = "xml";

Used for escapeString method for escape format to escape xml syntax.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

Methods

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

addParamsToUrl
public static java.lang.String addParamsToUrl(java.lang.String url, java.lang.String paramKey, java.lang.String paramValue)

Add parameter and its value to url. Override the value if the parameter is exist in the url.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

addParamsToUrl
public static java.lang.String addParamsToUrl(java.lang.String url, java.lang.String paramKey, java.lang.String[] paramValues)

Add parameter and its values to url. Override the value if the parameter is exist in the url.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

addParamsToUrl
public static java.lang.String addParamsToUrl(java.lang.String url, java.util.Map<java.lang.String, java.lang.String[]> params)

Add parameters and its values to url. Override the value if the parameter is exist in the url.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

constructUrlQueryString
public static java.lang.String constructUrlQueryString(java.util.Map<java.lang.String, java.lang.String[]> params)

Builds a query string based on parameters and its values.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

encodeUrlParam
public static java.lang.String encodeUrlParam(java.lang.String url)

Method used to properly encode the parameters in a URL string

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

mergeRequestQueryString
public static java.lang.String mergeRequestQueryString(java.lang.String queryString1, java.lang.String queryString2)

Method used to merge 2 query string. If same parameter found, the one from second query string will override the first query string.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

escapeRegex
public static java.lang.String escapeRegex(java.lang.String inStr)

Escape regex syntax in a string

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

escapeString
public static java.lang.String escapeString(java.lang.String inStr, java.lang.String format, java.util.Map<java.lang.String, java.lang.String> replaceMap)

Escape a string based on format and replaced string based on the replace keyword map

Parameters:

format - TYPE_HTML, TYPE_JAVA, TYPE_JAVASCIPT, TYPE_JSON, TYPE_SQL, TYPE_XML, TYPE_URL or TYPE_REGEX. Support chain escaping by separate the format in semicolon (;).

replaceMap - A map of keyword and new keyword pair to be replaced before escaping

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

decryptContent
public static java.lang.String decryptContent(java.lang.String content)

Decrypt all keywords in the content which wrapped in SecurityUtil.ENVELOPE with SecurityUtil.decrypt method.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

encryptContent
public static java.lang.String encryptContent(java.lang.String content)

Encrypt all keywords in the content which wrapped in SecurityUtil.ENVELOPE with SecurityUtil.encrypt method.

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

getUrlParams
public static java.util.Map<java.lang.String, java.lang.String[]> getUrlParams(java.lang.String url)

Converts all request parameters in an URL to a map

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

md5
public static java.lang.String md5(java.lang.String content)

Encrypt the content with MD5

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

md5Base16
public static java.lang.String md5Base16(java.lang.String content)

Encrypt the content with MD5 base16

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

searchAndReplaceByteContent
public static byte[] searchAndReplaceByteContent(byte[] bytes, java.lang.String search, java.lang.String replacement)

Search a keyword and replace it with a new keyword in byte content

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

searchAndReplaceByteContent
public static byte[] searchAndReplaceByteContent(byte[] bytes, java.util.Map<java.lang.String, java.lang.String> replacements)

Search keywords and replace it with corresponding new keyword in byte content

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

stripAllHtmlTag
public static java.lang.String stripAllHtmlTag(java.lang.String content)

Remove all HTML tags from the content

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

stripHtmlRelaxed
public static java.lang.String stripHtmlRelaxed(java.lang.String content)

Remove script and unknown tag from the content

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

stripHtmlTag
public static java.lang.String stripHtmlTag(java.lang.String content, java.lang.String[] allowedTag) 

Removed all HTML tags not in the allowed map from the content

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

validateEmail
public static boolean validateEmail(java.lang.String email, boolean multiple)

Method used for validate an email. Options to validate multiple email separated by semicolon (;)

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

Nested Class

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

IgnoreCaseComparator

public class IgnoreCaseComparator implements java.util.Comparator<java.lang.String>

A comparator to compare string value with letter case ignored

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

Methods

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

compare
public int compare(java.lang.String strA, java.lang.String strB)

Compare 2 strings with letter case ignored

License Error

The license of the app Translations for Confluence (formerly Language Macros) has expired. Please renew the license.

  • No labels