Tabnine Logo
StringUtil2.unreplace
Code IndexAdd Tabnine to your IDE (free)

How to use
unreplace
method
in
ucar.unidata.util.StringUtil2

Best Java code snippets using ucar.unidata.util.StringUtil2.unreplace (Showing top 9 results out of 315)

origin: edu.ucar/cdm

/**
 * Reverse XML quoting to recover the original string.
 *
 * @param x string to quote
 * @return equivilent string
 */
static public String unquoteXmlContent(String x) {
 return unreplace(x, xmlOutC, xmlInC);
}
origin: edu.ucar/cdm

/**
 * Reverse XML quoting to recover the original string.
 *
 * @param x string to quote
 * @return equivilent string
 */
static public String unquoteXmlAttribute(String x) {
 return unreplace(x, xmlOut, xmlIn);
}
origin: edu.ucar/netcdf

/**
 * Reverse XML quoting to recover the original string.
 *
 * @param x string to quote
 * @return equivilent string
 */
static public String unquoteXmlAttribute(String x) {
 return unreplace(x, xmlOut, xmlIn);
}
origin: edu.ucar/netcdf

/**
 * Reverse XML quoting to recover the original string.
 *
 * @param x string to quote
 * @return equivilent string
 */
static public String unquoteXmlContent(String x) {
 return StringUtil2.unreplace(x, xmlOutC, xmlInC);
}
origin: edu.ucar/netcdf

/**
 * Reverse XML quoting to recover the original string.
 *
 * @param x string to quote
 * @return equivilent string
 */
static public String unquoteXmlContent(String x) {
 return unreplace(x, xmlOutC, xmlInC);
}
origin: edu.ucar/cdm

/**
 * Reverse XML quoting to recover the original string.
 *
 * @param x string to quote
 * @return equivilent string
 */
static public String unquoteXmlContent(String x) {
 return StringUtil2.unreplace(x, xmlOutC, xmlInC);
}
origin: edu.ucar/netcdf

/**
 * Replace all occurences of orgReplace with orgChar; inverse of replace().
 *
 * @param x          operate on this string
 * @param orgReplace get rid of these
 * @param orgChar    replace with these
 * @return resulting string
 */
static public String unreplace(String x, String[] orgReplace, char[] orgChar) {
 // common case no replacement
 boolean ok = true;
 for (int i = 0; i < orgReplace.length; i++) {
  int pos = x.indexOf(orgReplace[i]);
  ok = (pos < 0);
  if (!ok) break;
 }
 if (ok)
  return x;
 // gotta do it
 StringBuilder result = new StringBuilder(x);
 for (int i = 0; i < orgReplace.length; i++) {
  int pos = result.indexOf(orgReplace[i]);
  if (pos >= 0) {
   unreplace(result, orgReplace[i], orgChar[i]);
  }
 }
 return result.toString();
}
origin: edu.ucar/cdm

/**
 * Replace all occurences of orgReplace with orgChar; inverse of replace().
 *
 * @param x          operate on this string
 * @param orgReplace get rid of these
 * @param orgChar    replace with these
 * @return resulting string
 */
static public String unreplace(String x, String[] orgReplace, char[] orgChar) {
 // common case no replacement
 boolean ok = true;
 for (String anOrgReplace : orgReplace) {
  int pos = x.indexOf(anOrgReplace);
  ok = (pos < 0);
  if (!ok) break;
 }
 if (ok)
  return x;
 // gotta do it
 StringBuilder result = new StringBuilder(x);
 for (int i = 0; i < orgReplace.length; i++) {
  int pos = result.indexOf(orgReplace[i]);
  if (pos >= 0) {
   unreplace(result, orgReplace[i], orgChar[i]);
  }
 }
 return result.toString();
}
origin: Unidata/thredds

/**
 * Replace all occurrences of orgReplace with orgChar; inverse of replace().
 *
 * @param x          operate on this string
 * @param orgReplace get rid of these
 * @param orgChar    replace with these
 * @return resulting string
 */
static public String unreplace(String x, String[] orgReplace, char[] orgChar) {
 // common case no replacement
 boolean ok = true;
 for (String anOrgReplace : orgReplace) {
  int pos = x.indexOf(anOrgReplace);
  ok = (pos < 0);
  if (!ok) break;
 }
 if (ok)
  return x;
 // gotta do it
 StringBuilder result = new StringBuilder(x);
 for (int i = 0; i < orgReplace.length; i++) {
  int pos = result.indexOf(orgReplace[i]);
  if (pos >= 0) {
   unreplace(result, orgReplace[i], orgChar[i]);
  }
 }
 return result.toString();
}
ucar.unidata.utilStringUtil2unreplace

Javadoc

Replace all occurrences of orgReplace with orgChar; inverse of replace().

Popular methods of StringUtil2

  • replace
    Replace any of the characters from out with corresponding character from in
  • remove
    Remove any of the characters in out from sb
  • substitute
    Find all occurences of the "match" in original, and substitute the "subst" string, directly into the
  • cleanup
    Delete any non-printable characters
  • splitString
    Split a string on one or more whitespace. Cover for String.split, because who can remember regexp?
  • unescape
    This finds any '%xx' and converts to the equivalent char. Inverse of escape().
  • collapseWhitespace
    Collapse continuous whitespace into one single " ".
  • allow
    Replace any char not alphanumeric or in allowChars by replaceChar.
  • breakTextAtWords
    Break the given text into lines, respecting word boundaries (blank space).
  • escape
    Escape any char not alphanumeric or in okChars. Escape by replacing char with %xx (hex).
  • getTokens
  • makeValidCdmObjectName
  • getTokens,
  • makeValidCdmObjectName,
  • padLeft,
  • padRight,
  • quoteHtmlContent,
  • filter7bits,
  • match,
  • quoteXmlAttribute,
  • removeFromEnd

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Reference (javax.naming)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now