Try this Carlos...

        Stringbuffer result = new StringBuffer();
        StringTokenizer st = new StringTokenizer("one two three");
        while (st.hasMoreTokens()) {
                result.append(capitalize(st.nextToken()));
        }
        System.out.println("capitalize result=="+result.toString());

        /**
        * Capitalize the first letter of a word.
        * @param s java.lang.String
        */
        // String capStr = TString.capitalize(input);
        public static String capitalize(String input)
        {
                char[] chars = input.toCharArray();
                chars[0] = Character.toUpperCase(chars[0]);
                return new String(chars);
        }

pb...



Carlos Santos wrote:
>
> Simple question:
>
> How do i convert
> "one two three"
> into
> "One Two Three " ?
>
> What functions or properties are there to do this sort of thing ?
>
> Thanks.
>
> -----------------------------------------------------
> CARLOS SANTOS  (ICQ: 21537583)
> NETOSFERA: http://www.netosfera.pt
> Tel(Phone): (+351 53 276998)
> Fax: (+351 53 274255)
> Braga - Portugal
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

--
Peter Blakeley
Head of Software Development Coolcat Software Pty. Ltd.
http://www.coolcat.com.au/
Director Bug Audit Services
http://www.coolcat.com.au/bug_audit


A financial instrument is a device used by a Banker to pick your pocket.
It is said an art degree is a licence to know it all, I am lucky I need
no art degree.
;-})

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to