Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Searching English words in a string
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Anuragnandan
Searching English words in a string
2 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


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.


Advertisement
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



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
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
reverse words in a string(words seperated byone or more spaces)
reverse words in a string(words seperated byone or more spaces)  reverse words in a string(words separated by one or more spaces
Breaking the String into Words
Breaking the String into Words     ... into words. The java.util.*; package provides you a simple method to breaking the string into separate words. This program takes a string from user and breaks
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
searching a text string in file - Java Beginners
searching a text string in file  code to match a string in a file that is already mentioned in java code.if the string matches any part of a string that whole string is printed
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
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 of the String
Reverse words of the String Java Programming In this section, we are going to reverse the words of the string. For this, we have allowed the user to enter... the string: java is a programming language Reversed Words: language
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
Count numbers of spaces and number of words from the input string
Count numbers of spaces and number of words from the input string Java In this section, you will learn how to count the number of spaces and words from the string. For this purpose, we have prompted the user to enter the 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
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
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
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
Searching - Hibernate
{ public static void main(String[] arg){ Session session = null; try...(); String SQL_QUERY = "from RecordInformation as record where record.userid LIKE... RecordInformation { private String userid; private String lastname; private String
Sorting and Searching
java.util.*; class RateJava { public static void main(String[] args
Find number of words begin with the specified character
: import java.util.*; class Words { public static void main(String...Count number of words begin with the specified character In this section, you will learn how to count the number of words that begin with the specified
Advertisements
 

 

 

DMCA.com