How to correct the case of letters and word spacing in some text

if the user inputs the text:
bird-watchers LOVE to watch birds.birds don't liKE
     being watched,so bird-watchers build boxes,called "hides" ,in which they
     can hide While they watch the birds .
the program should output:
Bird-watchers love to watch birds. Birds don't like being
watched, so bird-watchers build boxes, called "hides", in which
they can hide while they watch the birds.
Sentences start with a letter in upper case.
All other letters must be in lower case.
There should be two spaces after a period (.).
There should be one space after a comma (,).
Teacher said that reuse the right classes from the Java API would be easy to solve this problem, who can tell me a easier way to solve this problem

Got Eclipse running OK now then? It's my favorite IDE so far.
Check out java.util.StringTokenizer and java.io.StreamTokenizer classes. Which you choose depends on what you're planning to do, but reading the APIs should help you decide.
luck.

Similar Messages

  • Help for changing the case of a selected word of a multiline text to upper

    DBVersion:10g
    Foms Version:10g
    Hi Experts,
    Actually i have a requirement where i have to change the case of a selected word by a user into upper case.
    ex: FFFFFF hhhhh GGGG
    when user selects hhhhh and click on some button or any other option it should change it to upper case.
    plss help me out.
    regards :(
    Edited by: user123 on May 11, 2011 12:46 PM

    Here is some PL/SQL code to change a particular occurence of a word in a text.
    In this case, I change the second occurence of the "two" word:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> set serveroutput on
    SQL>
    SQL> declare
      2   c varchar2(100) := 'one two three four one two three four one two three four' ;
      3   c2 varchar2(100);
      4   i integer;
      5   j integer := 0 ;
      6   pos integer := 1 ;
      7   occurence integer := 2 ; -- occurence to change
      8  begin
      9   loop
    10    i := instr(c,'two', pos);
    11    exit when j = (occurence-1) or i = 0;
    12    j := j + 1;
    13    pos := pos + i ;
    14   end loop;
    15   i := instr(c,'two', pos);
    16   if i > 0 then
    17     c2 := substr( c,1,i-1) || upper(substr(c,i, length('two')))
    18        || substr(c, i+length('two'));
    19   end if ;
    20   dbms_output.put_line(c2);
    21  end;
    22  /
    one two three four one TWO three four one two three four
    PL/SQL procedure successfully completed.Francois

  • How to correct the birth date in Apple account? How to change the numerals to English for UAE location?

    I purchased iPhone 5S and opened new Apple account with preffered language English and location UAE. I was directed to enter my birth date with only Arabic language option. There was no way to change the language or skip the step. I had to enter an arbitrary birth date to go to the next step. How to correct the birth date now and change the numerals to English?

    Solution!!
    I was finally able to get the installer build to work, even though it takes about ten minutes!!  The network and CPU activity is minimal, so I don't know what LV is waiting on during all this time?
    For this installation it appears to be related to the directory structure created by the Volume License Manager 2.1 software.  There are two sets of users at my company, LabVIEW Professional and Developer Suite, which have different license numbers and installers.  The errors were related to source files located in the Products folder of the network distribution.  My installation expected the Products folder to be in a different location that it was actually placed by the VLM software.  I copied the entire Products folder from _SourceFiles up to the LabVIEW 8.5.1 folder and now it works, although very slowly.
    LabVIEW 8.5.1
    -->_SourceFiles
        -->Bin
        -->Device Drivers
        -->Licenses
        -->Products   (original location)
        -->Signal Express
    -->Dev Suite
    -->LV Pro
    -->Products    (manual copy)
    I hope this information may be of use to NI or other users.
    Message Edited by jrjones on 08-12-2008 03:21 PM
    Message Edited by jrjones on 08-12-2008 03:23 PM

  • I've tried downloading iOS5 several times and after an hour each time I get a message that says my network connection has timed out.  But I can't find any information about "timing out" or how to correct the situation.  Any help?

    I've tried downloading iOS5 several times and after an hour each time I get a message that says my network connection has timed out.  But I can't find any information about "timing out" or how to correct the situation.  Any help?

    Disable your antivirus and firewall, and try again.

  • Every time I download a file to my macbook pro, it saves it to downloads but changes the name and inserts % sign.  Please advise how to correct the name that it is saved under.

    Every time I download a file to my macbook pro, it saves it to downloads but changes the name and inserts % sign.  Please advise how to correct the name that it is saved under.

    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID.
    Apple ID FAQs
    http://support.apple.com/kb/HE37

  • I want to type "0800" or "20.00"; Pages automatically "corrects" the entries to: "800" and "20." !  How can I turn this automatic correcting OFF?

    In my business it is critical that I be able to enter numbers in the format I choose.  I want to type "0800" or "20.00"; Pages automatically "corrects" the entries to: "800" and "20." !  How can I turn this automatic correcting OFF?  I am a relatively new user of Pages and cannot find a means of turning the autocorrect OFF.or of setting the number formatting rules.

    Pages v5.5.2 does not change 0800, or 20.00 when entered as body text for me. There is nothing in substitution, or Pages preferences settings that can effect these values.
    However, when typed in a Pages table cell with the wrong data format, mischief does occur. In order to preserve 0800, select the Cell tab on the format panel, and set the cell data format to Text, or a custom data format. To preserve 20.00, you must set that cell data format to either Automatic with 2 decimals, or Number with 2 decimals.

  • I can't sign into Mozilla Foxfire the messages say crash I send the Crash Report, and look a detail, but not should were the crash started and how to correct the problem.

    I can't upload Mozilla Foxfire internet, an error message shown Crash, I sent the crash report but not happen. Also look at the crash report detail, I'm should were the crash started and don't no how to correct the problem
    == This happened ==
    Every time Firefox opened
    == may 18 2010 ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; (R1 1.6); InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

    Firefox will not open. I have the message "Firefox crashed" and a statement that Firefox will restore my tabs and send me a message, neither of which has happened.

  • I downloaded the new 6 software. Me and my boyfriend share the same iTunes account and now every time I text him I also get a copy of the text sent to my from my number. How do I get that to stop?

    I downloaded the new 6 software. Me and my boyfriend share the same iTunes account and now every time I text him I also get a copy of the text sent to my from my number. How do I get that to stop?

    Go to settings > messages > send & receive
    check or uncheck the correct phones numbers and/or email addresses

  • How to use the cases in button action?

    Hi Experts,
    I want to get a prompt message if the field is empty.I got it but at the same time if the field is filled I want the other action to be performed that is to call a BAPI and give me output.How can I give two events for the same action.
    How to use the cases in button action?
    So, please guide me.Urgent need
    Regards
    Nutan

    Hi Nutan,
    if I understand you, then you have a simple validation. Therefore you can use the validation functionality of VC for your components. An alternative could be by writing a new ABAP RFC function module like:
    BAPI Input parameters as input and BAPI output parameters as output and an additional return code or string for a message:
    IF I_FIELD IS INITIAL.
      E_RETURN_CODE = "THE FIELD IS EMPTY."
    ELSE.
      CALL FUNCTION <YOUR_BAPI>
      <BAPI PARAMETERS>
    ENDIF.
    I hope that helps.
    Best Regards,
    Marcel

  • How to establish the connection between crm and r/3

    Hi,
    Sorry for posting this question in this forum, i did not find any CRM forums.My question is,How to establish the connection between CRM and R/3...in my office i installed standard alone CRM system,but it is not talking to R/3.
    Could any one tell me where to find adapters and plugins for this.
    Thanks in advance.
    Ajey

    Hello Ajey,
    in the case you mean the connection between R/3 and SAP CRM you should read the Best Practice Guides:
    B01: CRM Generation
    C71: CRM Connectivity
    B09: CRM Replication
    from http://help.sap.com/bp_crmv240/index.htm. There is a CRM Forum at http://www.sap.com/community/ and also at http://www.sapfans.com/.
    Regards
    Gregor

  • How to get the NT user id and passwd

    Hi,
    How to get the NT user id and passwd using form 6i

    You cannot get the password. Password are stored in an encrypted format. Almost never decrypted (as a security meassure). Authentication is performed by encrypting the supplied password and matching that against the stored encrypted password.
    Think about it.. just how dangerous it will be to have a function that can dump NT users and their passwords for you. How can you ever expect to "simply decrypt a password"?
    As for getting the user name. See the Win32 kernel API call GetCurrentUser(). Also note that there is a big difference as to the owner/user of a server process/thread versus the end-user of client application (possibly running on another PC) that is making the call to the server.
    Of course, none of this is related to SQL or PL/SQL - which is what I believe the subject matter of this forum is... Kindly suggest that in future you pay attention to posting the correct subject material to the correct forum.

  • How to get the activity instance id and process id

    Dear All,
    For my case, my boss require the workflow program processor can be runtime assigned . After research, I found the coding example like below:
    // dynamically assign a user to a role
    rtm.addRuntimeDefinedUserToRole(
                      // process instance
                      prInstance,
                      // role name
                      "Processor",
                      // user that is assigned (IUser)
                      user,
                      // user context (IGPUserContext)
                      userContext);
    // dynamically change the user assigned to a role for a particular task
    String prInstanceID = prInstance.getID();
    rtm.changeTaskProcessor(
                      // process instance ID
                      prInstanceID,
                      // activity instance ID
                      activityInstanceID,
                      // current user (IGPUserContext)
                      currentProcessorContext,
                      // new user (IGPUserContext)
                      newProcessorContext);
    But I don't know how to get the process instance ID and activity instance ID before I can apply this api in my webdynpro application.
    Any gentllement can give me an idea.
    Thank you.
    Regards
    Eric

    process =  GPProcessFactory.getDesigntimeManager().getActiveTemplate(
                                  // by specifying its ID "CCD2C3F1BED111DD9DFA005056A9416C",/
                                                 /* and the user accessing it */ userContext);
         //          retrieve the Runtime Manager
         IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
         // create an empty role assignment list
         IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
         //Initialising the input params
         IGPStructure params =GPStructureFactory.getStructure(process.getInputParameters());
         params.setAttributeValue("Name",value);
         //Starting the process
         IGPProcessInstance prInstance = rtm.startProcess(process,"Process Name","Process name",user,roles,params,user);

  • While typing an email on iphone the letters and words don't appear for me to see but they appear for recipient of email

    When using my iphone 5 to type an email the letters and words do not appear for me to see what I'm typing but when I send to recipient the words and letters appear for them to see. Why is this happening and how can I fix it?  Thanks, kmg

    Hey hoosier 49!
    I have a couple of steps for you to try that may help you resolve this issue. First, attempt to force close the email app, then relaunch and test the issue again:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    If the issue is still unresolved, you may need to reset the phone according to the instructions in this article:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    Thanks for using the Apple Support Communities. Have a good one!
    -Braden

  • How do I delete photo ALBUMS from my iPHONE 4? I sync via icloud and I can not see any folders selected in itunes. I searched the internet and basically there is no one who has the answer to how you delete the iphone photo library and misc albums

    how do I delete photo ALBUMS from my iPHONE 4?
    I sync via icloud and I can not see any folders selected in itunes.
    I searched the internet and basically there is no one who has the answer (so far)
    to how you delete the iphone photo library and misc albums
    I have also had every iphone and I am not stupid.
    charles altman

    Replying to my own post - heh. I downloaded iExplorer (http://www.macroplant.com/iexplorer/) which allowed me access to the files on the phone and there was the phantom movie in the DCIM folder. Deleted it, and all is well - although I still have 0.65gb of Other in iTunes.....

  • How to change the Default login script and the USER login script in Netware3.12

    I need to cut down the disk map from Neware 3.12 in Win98 client's PC.
    please tell me
    how to change the Default login script and the USER login script in
    Netware3.12 ?
    Or is there any other ways to do this thing?
    Thanks a lot!

    On 4/6/2006 [email protected] wrote:
    > how to change the Default login script and the USER login script in
    > Netware3.12 ?
    Please repost in the discontinued.forums.
    Edison Ortiz
    Novell Product Support Forum SysOp
    (No Email Support, Thanks !)

Maybe you are looking for

  • Sending data to xport doesn't work correctly

    Dear programmers, For my thesis I have to send data from a computer to a microcontroller trough TCP/IP. So I've written a program in java dat sends the data, but it goes wrong. This is my code: import java.io.*; import java.net.*; public class Connec

  • How to add a jar file in the visual Age classpath

    I have to import a jar file in visual Age workspace, and don't know hox to do I tried several things, but didn't succeded at this point. I need to succed until tomorrow for completing my work. Please help, thanks.

  • Get read-only error when trying to create via CI

    I have created a component interface of the VCHR_EXPRESS component (along with the proper component fix for an initialization issue). I had VS generate a create_ex XML schema to be used by BizTalk (PS adapter) to create a new voucher. When I try to e

  • HOW to read file using ftp???

    Hi to all, I have problem with reading file using ftp connection, i want to read only 1024 bytes for one time, and i have next code wich read this: byte buffer[] = new byte[1024]; while( (readCount = input.read(buffer)) > 0) { bos.write(buffer, 0, re

  • Automatically output report to excel from a batch job

    We have business users who require that a standard report be run daily as a batch job and output to a printer, which is using a large pile of paper every day.  I have challenged the rationale for this without success, and am trying to find a way to c