Tabnine Logo
StringBuilder.codePointAt
Code IndexAdd Tabnine to your IDE (free)

How to use
codePointAt
method
in
java.lang.StringBuilder

Best Java code snippets using java.lang.StringBuilder.codePointAt (Showing top 20 results out of 342)

origin: JasonQS/Anti-recall

  public static String replaceFace(String s) {
    int indexOfPrefix = -1;
    StringBuilder sb = new StringBuilder(s);
    while ((indexOfPrefix = sb.indexOf(prefix, indexOfPrefix + 1)) > -1) {
      int index = sb.codePointAt(indexOfPrefix + 1);
      Log.e(TAG, "addMsg: s: " + s);
      Log.e(TAG, "addMsg: " + index);
      Log.e(TAG, "addMsg: indexOfPrefix: " + indexOfPrefix);
      Log.e(TAG, "addMsg: length: " + s.length());
      sb.replace(indexOfPrefix, indexOfPrefix + 2, strings[index]);
    }
    return sb.toString();
  }
}
origin: crashub/crash

buffer[i] = sb.codePointAt(i);
origin: org.opencypher/grammar

@Override
public int codePointAt( int index )
{
  return output.codePointAt( index );
}
origin: me.soliveirajr/menta-bean

public int codePointAt(int index) {
  return sb.codePointAt(index);
}
origin: jp.dodododo/samurai-dao

public int codePointAt(int index) {
  return delegator.codePointAt(index);
}
origin: org.fuwjin/grin

int codePointAt(final int index) {
 return builder.codePointAt(index);
}
origin: com.github.javaito/hcjf

public int codePointAt(int index) {
  return builder.codePointAt(index);
}
origin: io.virtdata/virtdata-lib-realer

int next() {
  int c = oldBuffer.codePointAt(pos);
  pos += Character.charCount(c);
  return c;
}
origin: jpcsp/jpcsp

private static void replaceFullWidthChar(StringBuilder s, int index, int codePointOffset) {
  int codePoint = s.codePointAt(index);
  char chars[] = new char[2];
  if (Character.toChars(codePoint + codePointOffset, chars, 0) == 1) {
    s.setCharAt(index, chars[0]);
  }
}
origin: cflint/CFLint

private String escapeControlCharacters(final String value) {
  StringBuilder sb = new StringBuilder(value);
  for (int i = 0; i < sb.length(); i++) {
    final int codePoint = sb.codePointAt(i);
    if (Character.isISOControl(codePoint)) {
      final String encode = UnicodeCharEncoder.encode(codePoint);
      sb.replace(i, i + 1, encode);
    }
  }
  return sb.toString();
}
origin: com.jtransc/jtransc-rt

@Override
@JTranscAsync
public synchronized int codePointAt(int index) {
  return super.codePointAt(index);
}
origin: cflint/CFLint

private String escapeControlCharacters(final String value) {
  StringBuilder sb = new StringBuilder(value);
  for (int i = 0; i < sb.length(); i++) {
    final int codePoint = sb.codePointAt(i);
    if (Character.isISOControl(codePoint)) {
      final String encode = UnicodeCharEncoder.encode(codePoint);
      sb.replace(i, i + 1, encode);
    }
  }
  return sb.toString();
}
origin: io.virtdata/virtdata-lib-realer

/**
 * Return the current character in the normalized text.
 * @return The codepoint as an int
 * @deprecated ICU 56
 */
@Deprecated
public int current() {
  if(bufferPos<buffer.length() || nextNormalize()) {
    return buffer.codePointAt(bufferPos);
  } else {
    return DONE;
  }
}
origin: org.apache.brooklyn/brooklyn-utils-common

/** merges paths using forward slash as the "local OS file separator", because it is recognised on windows,
 * making paths more consistent and avoiding problems with backslashes being escaped.
 * empty segments are omitted. */
public static String mergePaths(String ...items) {
  char separatorChar = '/';
  StringBuilder result = new StringBuilder();
  for (String item: items) {
    if (Strings.isEmpty(item)) continue;
    if (result.length() > 0 && !isSeparator(result.codePointAt(result.length()-1))) result.append(separatorChar);
    result.append(item);
  }
  return result.toString();
}
origin: io.virtdata/virtdata-lib-realer

/**
 * Return the next character in the normalized text and advance
 * the iteration position by one.  If the end
 * of the text has already been reached, {@link #DONE} is returned.
 * @return The codepoint as an int
 * @deprecated ICU 56
 */
@Deprecated
public int next() {
  if(bufferPos<buffer.length() ||  nextNormalize()) {
    int c=buffer.codePointAt(bufferPos);
    bufferPos+=Character.charCount(c);
    return c;
  } else {
    return DONE;
  }
}
origin: edu.ucar/netcdf

/**
 * Convert a name to a legal netcdf-3 name.
 * @param name convert this name
 * @return converted name
 */
static public String makeValidNetcdfObjectName(String name) {
 StringBuilder sb = new StringBuilder(name.trim()); // remove starting and trailing blanks
 while (sb.length() > 0) {
  char c = sb.charAt(0);
  if (Character.isLetter(c) || Character.isDigit(c) || (c == '_')) break;
  sb.deleteCharAt(0);
 }
 int pos = 1;
 while (pos < sb.length()) {
  int c = sb.codePointAt(pos);
  if (((c >= 0) && (c < 0x20)) || (c == 0x2f) || (c == 0x7f)) {
   sb.delete(pos, pos + 1);
   pos--;
  }
  pos++;
 }
 if (sb.length() == 0)
  throw new IllegalArgumentException("Illegal name");
 return sb.toString();
}
origin: omegat-org/omegat

boolean isSpaces(Token token) {
  for (int cp, i = 0; i < token.getLength(); i += Character.charCount(cp)) {
    cp = str.codePointAt(token.getOffset() + i);
    if (!Character.isWhitespace(cp)) {
      return false;
    }
  }
  return true;
}
origin: omegat-org/omegat

boolean isPossibleBreakBefore(int pos) {
  try {
    // check previous char. Can't split after specified chars.
    int cp = str.codePointBefore(pos);
    // U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    // U+201E DOUBLE LOW-9 QUOTATION MARK
    if (":\\([{<\u00ab\u201e".indexOf(cp) >= 0) {
      return false;
    }
  } catch (StringIndexOutOfBoundsException ex) {
  }
  try {
    // check next char. Can't split before specified chars.
    int cp = str.codePointAt(pos);
    // U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    // U+201C LEFT DOUBLE QUOTATION MARK
    if ("{:)]}>\u00bb\u201c,.".indexOf(cp) >= 0) {
      return false;
    }
  } catch (StringIndexOutOfBoundsException ex) {
  }
  return true;
}
origin: omegat-org/omegat

/**
 * Finds the Xtag corresponding to an OmegaT tag
 *
 * @param tag
 *            OmegaT tag, without &lt; and &gt;
 * @return either the original Xtag, or the tag with &lt; and &gt;
 *         characters converted to the Xtag equivalent
 */
private String findTag(StringBuilder tag) {
  for (Xtag oneTag : listTags) {
    if (oneTag.toShortcut().equals(tag.toString())) {
      return oneTag.toOriginal();
    }
  }
  // It was not a real tag
  // We must convert < to <\<> and > to <\>>
  StringBuilder changedString = new StringBuilder();
  for (int cp, i = 0; i < tag.length(); i += Character.charCount(cp)) {
    cp = tag.codePointAt(i);
    changedString.append(convertSpecialCharacter(cp));
  }
  return changedString.toString();
}
origin: com.sqlapp/sqlapp-core

/**
 * 表示上の幅を取得します。
 * @param val
 */
public static int getDisplayWidth(StringBuilder val){
  if (val ==null){
    return 0;
  }
  int count=0;
  int i=0;
  int codePointLen=val.codePointCount(0, val.length());
  while(i<codePointLen){
    int codePoint=val.codePointAt(i++);
    if (isHalf(codePoint)){
      count++;
    } else{
      count=count+2;
    }
  }
  return count;
}
java.langStringBuildercodePointAt

Popular methods of StringBuilder

  • append
  • toString
  • <init>
    Constructs a string builder initialized to the contents of the specified string. The initial capacit
  • length
  • setLength
  • charAt
  • deleteCharAt
  • insert
  • substring
  • delete
  • replace
  • setCharAt
  • replace,
  • setCharAt,
  • indexOf,
  • lastIndexOf,
  • reverse,
  • appendCodePoint,
  • getChars,
  • subSequence,
  • ensureCapacity,
  • trimToSize

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top Sublime Text plugins
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