find all unique character in string using java

Ads
 

find all unique character in string using java

example: hello how are you. output should be waryu

View Answers

July 8, 2013 at 1:01 PM

String first="AAABBCCCCDDD";
String newFirst="";
for(int i=0;i<first.length();i++)
{ 
     if(newFirst.indexOf(first.charAt(i))==-1)
      newFirst+=first.charAt(i);
}
System.err.println("The Unique Charactes in the String:"+newFirst);

July 8, 2013 at 10:07 PM

please post complete answer..

Ads









Related Tutorials/Questions & Answers:
find all unique character in string using java
find all unique character in string using java  example: hello how are you. output should be waryu
tO FIND UNIQUE WORDS IN A FILE USING HASHMAP
tO FIND UNIQUE WORDS IN A FILE USING HASHMAP  import java.util.*; import java.io.*; public class countunique { private String[] splitter; private int[] counter; /* * @param String - represents the sentence
Advertisements
Java String : Replace All
Java String : Replace All This section defines how to replace all character with specified character without using system methods. Replace All method : You can replace all specific character in a given string with another character
2. Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
2. Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1 Abracadabra, 2 Abracadabra, 3
plz give me program to this: Given a string and a number ‘n’, find the ‘n’th distinct repeating character.
plz give me program to this: Given a string and a number ?n?, find the ?n?th distinct repeating character.    Given a string and a number ?n?, find the ?n?th distinct repeating character. For example, Input: Abracadabra, 1
Java Remove a character from string
Java Remove a character from string In this tutorial, you will learn how to remove a character from the string. There are several methods for examining... to remove a particular character from the string. In the given example, we have
find the first character is vowel or not
find the first character is vowel or not  hi friend, can u plz send me javascript code for find the wether the first character is a vowel or not. 2) check wether the last character is same as the first character or not 3) check
Find out last character of array
Find out last character of array  How we can find out the last character of array in java program
how to find the sum of integers in a string of sentence in java
how to find the sum of integers in a string of sentence in java  how to find the sum of integers in a string of sentence in java for e.g:--> abc d 2 3 21 the output should be 2+3+21=26
How to display string or character
How to display string or character  how to print character or a word without using array concept
How to store unique values in Java using Set?
Store unique values in Java using Set interface In this section we... will show you how to store unique values in Java using Set? The Set interface... the unique values. Here is the example program to store unique values in Java using
How to store unique values in Java using Set?
Store unique values in Java using Set interface In this section we... will show you how to store unique values in Java using Set? The Set interface... the unique values. Here is the example program to store unique values in Java using
count the repeated character in one string
count the repeated character in one string  to find the how character occurrence in one String (for example the string is -java means there is 2... java.util.*; class CountCharacters { public static void main(String[] args) throws
String length without using length() method in java
String length without using length() method in java  How to count length of string without using length() method in java?   Here is Example... the number of character into the given string without using the length() method
java string replace all non digits
java string replace all non digits  Hi, I am doing some processing on the text data. I have requirement to remove all the charaters from the data except the digits. How to replace all non digits in a string with some character
Removing character from a string in sql.
Removing character from a string in sql.  How to remove or replace character from a string
How to split string in Java using comma?
How to split string in Java using comma?  Hi, Share the example code for splitting the string in Java using comma as separator. Thanks   ...(","); You can check the thread How to split string in Java?. Thanks
Java charAt() method
. This method is used to find the character at the specified index of the specified...); System.out.println("Character at index "+index+" of String "+text...Java charAt() method In this section we will read about the chartAt() method
J2ME count character into string
J2ME count character into string  i am new in J2ME, my problem is how to count character into number, i had been research google for almost 2 days... form which allow user to input character user input helloworld then press
Write a java program that encrypt and decrypt some string by adding or removing 2 on each character.
Write a java program that encrypt and decrypt some string by adding or removing 2 on each character.  Write a java program that encrypt and decrypt some string by adding or removing 2 on each character. Example 1 : Please Enter
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
Program using String functions - Java Beginners
Program using String functions  Write a program to accept a sentence and find out how many times the word "the" occurs?  Hi Friend, Try... { public static void main(String[] args) { int count = 0
Determining the Character Boundaries in a Unicode String
Determining the Character Boundaries in a Unicode String In this section,  you will learn how to determine the character boundaries in a string. By determining the character boundaries, you will be able to break the string
write a java program to find the summation of all the integers entered on command line
write a java program to find the summation of all the integers entered on command line  Hi, write a java program to find the summation of all the integers entered on command line? How to write Java program for summation of all
java programmming: string manipulation
java programmming: string manipulation  WAP to accept a string from the user, using buffered reader and then find the frequency of character 'e... the command prompt and find the frequency of the character e in the input string
how to count words in string using java
how to count words in string using java  how to count words in string using corejava   Hi Friend, Try the following code: import java.util.*; class CountWords{ public static void main(String[] args
find a substring by using I/O package
find a substring by using I/O package  Write a java program to find a sub string from given string by using I/O package
MySql find and replace string
MySql find and replace string  How to find and replace string or special characters in MySql & PHP?   Find and Replace String PHP $result = preg_replace('/\band\b/i', 'foo', $subject
Convert a string representation of a hex dump to a byte array using Java?
Convert a string representation of a hex dump to a byte array using Java?  Convert a string representation of a hex dump to a byte array using Java
How to find the size of a dynamic webpage using java... eg : Youtube........
How to find the size of a dynamic webpage using java... eg : Youtube... args the command line arguments */ public static void main(String...... Please help... Thanks, Ramit   the above code is running on JAVA
Java String
Java String       In this section, you will learn about the java string. Java String is a set.... All String literals are instances of this class and two string literals

Ads