delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

3) i also need to know how to replace a space with underscore
eg " " to "_".


1) i need to know how to change a String first character to uppercase.
2) i also how to change all characters to lower case.
3) i also need to know how to replace a space with underscore
eg " " to "_".

TOP

if you are on unix use sed:  here is a simple example of how to change any letter a with b in some file
sed 's/a/b/g' somefile
once you can figure out the regular expression it should be easy.  if you need help with regex let me know.

TOP

Take a look at the docs for java.lang.String: http://java.sun.com/j2se/1.4/docs/a...ang/String.html

TOP

/*        Example.java
*/
public class Example{
        public static void main(String[] args){
                Example example = new Example();
                example.test();
        }
        public void test(){
                String someString = "la la la la la la la";
                /* 1) i need to know how to change a String first character to uppercase. */
                String string1 = someString.substring(0,1).toUpperCase() +  someString.substring(1);
                /* 2) i also how to change all characters to lower case. */
                String string2 = someString.toUpperCase();
                /* 3) i also need to know how to replace a space with underscore
                eg " " to "_". */
                String string3 = someString.replace(' ','_');
                System.out.println(someString);
                System.out.println(string1);
                System.out.println(string2);
                System.out.println(string3);
        }
}



3) i also need to know how to replace a space with underscore
eg " " to "_".

TOP

Back Forum