Question: find all unique character in string using java

Ads

 
 
 

Share on Google+Share on Google+

shashi
find all unique character in string using java
2 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners

example: hello how are you. output should be waryu

Ads
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
Find Successively Repeated Character using Java
Find Successively Repeated Character using Java In this section, we are going to find the successively repeated character using Regular Expression...;Main_Class{ public static void main(String[] args
Advertisements
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
Find Character form String example
() method to find out the character in the string with the help of index position, and also find the character code using charCodeAt() method. User can see how... .style1 { font-size: medium; } Find characters from String example
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
Find sum of all the elements of matrix using Java
Find sum of all the elements of matrix using Java A matrix is a rectangular... dimensional array. Now to determine the sum of all these elements, we have..., this variable get the sum of all the elements. Here is the code: import java.io.
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
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
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
Split string after each character using regular expression
Split string after each character using regular expression... to split the String after each character using expression. For this we are going to make program named SplittingFind. java. The steps involved in program
Find Longest Word from the string using Java
Find Longest Word from the string using Java Here we are going to find the longest word from the string. For this, we have specified the string which is then splitted into string array using  split() method. Then we have created
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
String fromCharCode() method example in Action Script3
in Action Script3:- String provide a method to find characters by the character code using fromCharCode() method. we have define a string using this method. User can see how to use this method to find string. Example:- <
How to display string or character
How to display string or character  how to print character or a word without using array concept
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
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
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
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
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
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
Removing character from a string in sql.
Removing character from a string in sql.  How to remove or replace character from a string
Removing character from a string in sql.
Removing character from a string in sql.  Removing special characters from a string in sql
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
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
In data structure in java how to parse the given string and counts the member of character that match the given data?
In data structure in java how to parse the given string and counts the member of character that match the given data?  Design a parser that parse the given string and counts the member of character that match the given data.using
Replacing all the text of String using expression
Replacing all the text of String using expression... into a pattern. Here 'k|K' means to replace all in place of character (k or K). String... to Replace certain part of the whole String using regular expression. For this we
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
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
array find all possible dimension
array find all possible dimension  Given array: int[] dimension = { 1, 2, 3 }; That produces the output: 1 2 3 12 13 23 123 I'm new to array...i can't figure out the way on even how to start... any idea?...really appreaciate
Tutorials   
Java Spring Hibernate Struts Training What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly?

Ads

 
Advertisement null

Ads