Searching English words in a string

Ads
 

Searching English words in a string

My task is to find English words and separate them from a string with concatenated words..for example

AhdgdjHOWAREgshshYOUshdhfh

I need to find if there exists any English words.

View Answers

January 22, 2011 at 11:24 AM

Hi Friend,

Try this:

public class SeparateWords{
    public static void main(String[]args){

    String st="AhdgdjHOWAREgshshYOUshdhfh";
    char ch[]=st.toCharArray();
    for(int i=0;i<ch.length;i++){
        if(Character.isLetter(Character.valueOf(ch[i]))){
            if(Character.isUpperCase(Character.valueOf(ch[i]))){
                System.out.print(Character.toString(ch[i]));
            }
        }
        System.out.print(" ");
    }
  }
}

Thanks


January 23, 2011 at 1:27 AM

I've just used the upper case letters in the string just to highlight existing of English words in the string..Actual task doesn't have any upper case letters

Ads









Related Tutorials/Questions & Answers:
Searching English words in a string
Searching English words in a string  My task is to find English words and separate them from a string with concatenated words..for example AhdgdjHOWAREgshshYOUshdhfh I need to find if there exists any English words.   
searching string
searching string   how to write a program for searching a string...{ public static void main(String[] args){ Scanner input=new Scanner(System.in); System.out.println("Enter string: "); String str = input.nextLine
Advertisements
ModuleNotFoundError: No module named 'english-words'
ModuleNotFoundError: No module named 'english-words'  Hi, My... 'english-words' How to remove the ModuleNotFoundError: No module named 'english-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'english-words'
ModuleNotFoundError: No module named 'english-words'  Hi, My... 'english-words' How to remove the ModuleNotFoundError: No module named 'english-words' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'english-words'
ModuleNotFoundError: No module named 'english-words'  Hi, My... 'english-words' How to remove the ModuleNotFoundError: No module named 'english-words' error? Thanks   Hi, In your python
searching the string in a paragraph?
searching the string in a paragraph?  how to search a string in a paragraph and display the corresponding line number and position of a string in java
ModuleNotFoundError: No module named 'possible-english-words'
ModuleNotFoundError: No module named 'possible-english-words'  Hi...: No module named 'possible-english-words' How to remove the ModuleNotFoundError: No module named 'possible-english-words' error? Thanks   Hi
Java String searching.
Java String searching.  How to search a string in given String array... static void main(String[] args) { String city[] = { "Delhi", "Lucknow", "Mumbai", "Kanpur" }; String userCity; Scanner scanner = new
Count words in a string method?
Count words in a string method?  How do you Count words in a string... count the length of arr which return the number of words in the inputted string... java.util.StringTokenizer; public class StringCount { public static void main(String [] args
JavaScript split string into words.
JavaScript split string into words.  How to split string into words...; Description: The split() method is used to split a string into an array... which is used for splitting the string. If you don?t put any separator
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
Java: Searching a string from doc files
Java: Searching a string from doc files   I want to search a string from DOC, DOCX files in java. Can anyone please help me
A Program To Reverse Words In String in Java
A Program To Reverse Words In String in Java  A Program To Reverse Words In String in Java for example: Input:- Computer Software Output... Tell Me This Program.  Here is an example that reverse the words
Breaking a string into words without using StringTokenizer
Breaking a string into words without using StringTokenizer  how can we Break a string into words without using StringTokenizer ??   The given code convert the string into words. import java.util.*; class StringExample
how to count words in string using java
how to count words in string using java  how to count words in string... java.util.*; class CountWords{ public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter string
Java reverse words in a string using only loops
Java reverse words in a string using only loops In this tutorial, you will learn how to reverse words in a string without using any inbuilt methods like...[start++]=c[end]; c[end--]=temp; } return c; } public static void main(String
Java count frequency of words in the string
Java count frequency of words in the string. In this tutorial, you will learn how to count the occurrence of each word in the given string. String... of words in a string. In the given example, we have accepted a sentence
searching books
searching books  how to write a code for searching books in a library through jsp
searching technique
searching technique  Hi, i need any searching technique in java to search the data and give the all possible data by links
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
searching problem
searching problem  how we can make a code in core java for searching in hard disk? i have to make an antivirus as my minor project , so i have need this type code to search the virus in hard disk
file searching
file searching  i need a prog for searching inside a text file after evry 1 min to find does it hav any new entry
string
inputString = br.readLine(); FirstLetter letter=new FirstLetter(); String words...string  a java program to input a string and display the string...*; import java.io.*; public class FirstLetter{ public static String
searching the data
searching the data  respected sir , i am making the desktop application , so how can i search the data which are stored in the mysql databses through click the button and display in jtable through netbeans dynamically
string
); String s = ""; System.out.println("Words... and also displaying that contain word? Like I want to find "a" in the string... and a character. It then count the occurrence of that character in the string and display
SQNco EN/FA Dictionary
SQNco EN/FA Dictionary       The Best and Newest English / Farsi Dictionary,Free Searchable English-Farsi and Farsi-English dictionary with more than 70000 words. Read full Description
Sorting and Searching
java.util.*; class RateJava { public static void main(String[] args

Ads