Share on Google+Share on Google+

R.S.E.
WordExtractor.java
1 Answer(s)      7 years ago
Posted in : Framework

Ads

View Answers

June 29, 2009 at 12:03 PM


Hi Friend,

Try the following code:

import java.util.Scanner;

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

System.out.println("Enter a sentence to form a new word: ");
Scanner input=new Scanner(System.in);
String st=input.nextLine();
String word=st.substring(0, 1);
for(int i=0;i<st.length();i++){
if(st.charAt(i)==' '){
word=word+st.substring(i+1, i+2);
}
}
System.out.println(word);
}
}

Thanks









Related Tutorials/Questions & Answers:
WordExtractor.java - Framework
WordExtractor.java  I am looking to put together a program that identifies a letter from a sentence to form a word. Can you get me started in the right direction on how to do this?  Hi Friend, Try the following code
Tutorials   
Java Spring Hibernate Struts Training Spring 3 MVC Login Form Example Spring 3 MVC Login Form Example Error with LogIn with mysql database Selenium webdriver - Getting Xpath for element in IE Selenium webdriver - Getting Xpath for element in IE springframework Industrial problem maths Groovy Editor using Eclipse RCP Plugin Development Selenium-HP-Alm framework containment how to implement Single Sign On in enterprise application using spring framework Deploy war file Hadoop Mapreduce Java spring 15/03/14 How to found which class or method contain specific annotation? com.pixelmed.dicom.DicomException: No reader for jpeg-lossless available What is Software development framework? pie chart Struts 2 is it necessary to have depth knowledge on servlets jsp and jdbc to learn java frameworks Spring MVC and Hibernate with DWR 3 -- Configuration Using MySQL Database Spring Validations project web programming web programming is it possible to display page in full frame...after dividing page into frames...and is it possible to close frame write code in c# in an application one task has to done for every 15 minutes ? How con you do it? What is the structure of Spring framework? Scheduler triggering cron jobs multiple times at the scheduled time and job is retained even after deleting How to align the select tags in a single column. struts 1.3 array matrix i got illegal start of expression error , plese tell me the mistake where i did... zend2 frame work Spring Login Page Error not able to deploy application war on JBOSS 6.0 running on linux 5.5 URL Regular Expression for Struts Validator URL Regular Expression for Struts Validator getOutputStream() has already been called for this response how to develope a struts application using hibernate? Dialling from computer with other phone via modem card ORACLE- ATG -E Commerce ORACLE- ATG -E Commerce struts need of frameworks in java? need of frameworks in java? need of frameworks in java?

Ads

 
Advertisement null

Ads