Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

quitar letras repetidas de una palabra en java

public static void removeDuplicates(char[] str) {
  if (str == null) return;
  int len = str.length;
  if (len < 2) return;
  int tail = 1;
  for (int i = 1; i < len; ++i) {
    int j;
    for (j = 0; j < tail; ++j) {
      if (str[i] == str[j]) break;
    }
    if (j == tail) {
      str[tail] = str[i];
      ++tail;
    }
  }
  str[tail] = 0;
}
Comment

PREVIOUS NEXT
Code Example
Java :: Goodbye to "Inspect Element" 
Java :: how to code the overdraft limit in Java 
Java :: intellij run single java file 
Java :: Java labeled break Statement 
Java :: getcokor from drawable in java android studio 
Java :: method overloading in java 
Java :: java data table source tymeLeaf 
Java :: Draw an item using System.out.println 
Java :: free marker templates 
Java :: generate paranthesis 
Java :: java decrypt CryptoJS 
Java :: java Prefix Sum of Matrix (Or 2D Array) 
Java :: nullpointer extension 
Java :: how to array list with a delimiter into text file java 
Java :: springfox 3.0.0 incompatibile spring boot 2.6.0 
Java :: how to load template file from resource folder in spring boot project 
Java :: hibernate getList of a table 
Java :: Java double Keyword 
Java :: java logger errorAdd Answer 
Java :: check if item lore is something bukkit 
Java :: Uri/beecrowd problem no 1118 solution in Java 
Java :: recycler view event being raised multiple times 
Java :: binary search tree 
Java :: how to use a switch statement in java 
Java :: || in java 
Java :: java program to print vowels in a string 
Java :: compare two strings java 
Java :: update role spring security 
Java :: int in string umwandeln 
Java :: exitonclose swing 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =