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

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
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
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
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
How to display string or character
How to display string or character  how to print character or a word without using array concept
Find String Values of Cell Using POI
Find String Values of Cell Using POI       In this program we are going to find the String... FindStringCellsValues.java C:\POI3.0\exmples\execl>java FindStringCellsValues example.xls String
Replace Character in String
in a given string. To replace a character with the given character in sting first... find then replace the "oldChar" with newChar (character name to replace...:\replace>java Replace Your String before repalce rajesh raju raja rahul ray rani ram
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
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
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 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
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
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
Get Character from String
Get Character from String     ... toCharArray() to convert string to character array. 3. Retrieve character from character array one by one using for loop.        Here
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 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
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
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
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
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
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
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
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
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
Convert Character into a String
the functionality to convert a character into a string.  Code Description: This program takes a character at the console and converts it into a string format using... Convert Character into a String   
String Determining a Character's Unicode Block
String Determining a Character's Unicode Block   ... explanation about the UnicodeBlock() method of String class. We are going to use UnicodeBlock() method of String class in Java. The description of the code is given
how to convert string to char array in java without using tochararray
how to convert string to char array in java without using tochararray  Hi, I want to convert the String object in java without the toChararray() function. how to convert string to char array in java without using
find the given input is integer or string
find the given input is integer or string  simple coding for to check... CheckValue { public boolean checkIfNumber(String in) { try...(String[] args) { String str="22222"; CheckValue v=new
Java Write To File From String
Java Write To File From String In this tutorial you will learn how to write to file from string. Write to file from string using java at first we will have to first create a file using the File (in case of the file is not existed
string palindrom using vbscript?
string palindrom using vbscript?  string palindrom using vbscript
Count the character in java
Count the character in java  Write a java program to count the character â??aâ?? typed by the user in a paragraph by implementing thread... CountCharacters { public static void count(final String str){ Runnable
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
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
Search string using substring
Search string using substring  I want to print a string by searching a substring of that string. - i want to print email-ids from word files (resumes) in a directory. Search can be made using @ in the word file. So far i can
String Reverse Using StringUtils
String Reverse Using StringUtils       In this example we are going to reverse a given string using...:\rajesh\kodejava>java StringReverseUsingStringUtils The original String: Hi
Java String Occurrence in a String
Java String Occurrence in a String   .... Description of the code: In the program code given below, we will find another String...();. And once it will find the string at the given position then it will display
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 split string after first occurrence of alphanumeric character?
how to split string after first occurrence of alphanumeric character?  String strArray="135(i),15a,14(g)(q)12,67dd(),kk,159";//splited by ',' divide string after first occurrence of alphanumeric value/character expected output
cannot find symbol method append(String)
cannot find symbol method append(String)  what is the solution for cannot find symbol method append(String)?   Hi, Check tutorials: How To Append String In Java? Java - StringBuffer class in Java Thanks
cannot find symbol method append(String)
cannot find symbol method append(String)  what is the solution for cannot find symbol method append(String)?   Hi, Check tutorials: How To Append String In Java? Java - StringBuffer class in Java Thanks
Write a method which will remove any given character from a string?
Write a method which will remove any given character from a string? In this example we will describe remove any given character from a string... argument. It checks the character you want to remove in the string in a sequence
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
Character Directions in java
Character Directions in java  java 2,version 1.4 adds a method "getDirectionality();" , what is the use of this method ?   This method returns the Unicode directionality property for the given character. Character
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
Array of String using Pointers
of string using pointers in C. The declaration of an array of character pointers is an extremely useful extension to single string pointer declarations... Array of String using Pointers   

Ads