Char to upper case

Hello:
The question is simple..
How do you people convert a char to upper case?
Regards
pete

this way is good enough as for me:
               char c = chars;
               String s = String.valueOf(c);
               result.append("[" + s.toUpperCase() + s.toLowerCase() + "]");

Similar Messages

  • Change a char to upper Case

    How can I use this "toUpperCase"
    e.g.
    char a = 'b';
    a=toUpperCase(a);
    I can't compile it.
    Please help me to solve this problem..thank you...

    use this:
    char a = 'b';
    a=Character.toUpperCase(a);
    best regards

  • Converting char to upper

    How can I convert a char to upper case like you would a string?
    char code;
    String Stringcode;
    code = letter.getText().charAt(0);
    Stringcode = String.valueOf(code).toUpperCase();
    Can't I just convert the char to upper?

    public class Test {
        public static void main (String[] parameters) {
            for (char ch = 'a'; ch <= 'z'; ch ++) {
                System.out.print (Character.toUpperCase (ch));
    }

  • Changing to Upper case?

    Is easy way to change the input character
    from keybord to upper case directly, i mean
    at the same time when the user press a key,
    the upper case show up on textField? Or i have to do that manually when cursor/mouse
    left the textField?
    Ali
    null

    cut&paste from the swing doc javax.swing.jtextfield:
    public class UpperCaseField extends JTextField {
    public UpperCaseField(int cols) {
    super(cols);
    protected Document createDefaultModel() {
    return new UpperCaseDocument();
    static class UpperCaseDocument extends PlainDocument {
    public void insertString(int offs, String str, AttributeSet a)
    throws BadLocationException {
    if (str == null) {
    return;
    char[] upper = str.toCharArray();
    for (int i = 0; i < upper.length; i) {
    upper[i] = Character.toUpperCase(upper);
    super.insertString(offs, new String(upper), a);
    null

  • How can I read an input which only contain the 26 upper case letter

    Are there any method that can read an input which only contain 1 character and it is in upper case too.
    should I use readChar( ), or readString( )??
    How should I implement them if I do use one of them?
    thx

    Try this :
    import java.io.*;
    public class Read
    public static void main(String[] x)
    System.out.println("Upper case char typed : "+readUpperCaseChar());
    public static char readUpperCaseChar()
    // method that read char and return the last upper case char
    char x='\0',tmp='\0';
    try
    while(tmp!='\n')
    tmp=(char) System.in.read();
    if(tmp >= 'A' && tmp <= 'Z')
    x=tmp;
    catch(IOException ioex)
    ioex.printStackTrace();
    return x;

  • Conditional Upper Case formatting

    Hi there, I need to be able to format the first letter of a word upper case or lower case depending upon whether or not it appears at the start of a sentence. There must be a method of doing this using the String class. Any ideas folks? All contributions greatly appreciated!

    It's a remarkably difficult problem to determine whether a sequence of chars constitutes a word, and what constitutes a sentence, especially considering that Java strings can be used to contain text in not only English but also Thai and Inuktitut and Coptic and all of the world's written languages. So perhaps it isn't all that surprising that the language designers didn't feel it necessary to solve that problem within the String class.
    However if you have a more restrictive problem domain then perhaps you have an easier problem.

  • Translate to Upper Case in Transformation

    Hello BI experts,
    Extractor has more than 100 fields in combination of Char, Num, Date etc...
    Some Char fields are bringing data in lower case letters. 
    Here I am looking for ABAP code in Start routine, where I can translate all Char fields lower case letter to Upper case.
    I know how to translate for each individual field level (infoobject routine level).  But I need in Start routine for all Char fields at once.  In other words,  I think, we have to filter out Char fields from <Source-Fields> and translate them to Upper case.
    Any help would be greatly appreciated.
    Thanks much,
    Anil

    Hi,
    try the following logic in start routine& let me know if you find any difficulty..
    data : r_itab type table of rstrucinfo,
              v_sytabix like sy-tabix,
              wa type rstrucinfo.
        FIELD-SYMBOLS : <fs1> type any,
                     <fs2> type any.
        CALL FUNCTION 'GET_COMPONENT_LIST'
          EXPORTING
            program    = sy-repid
            fieldname  = 'SOURCE_PACKAGE'
          TABLES
            components = r_itab[].
        loop at SOURCE_PACKAGE assigning <fs2>.
          v_sytabix = sy-tabix.
          loop at r_itab into wa where TYPE = 'C'.
            assign component wa-COMPNAME of structure <fs2> to <fs1>.
            translate <fs1> to upper case.
          endloop.
          modify SOURCE_PACKAGE from <fs2> index v_sytabix.
        endloop.
    regards,
    raju

  • Issue with upper case in cyrillic characters - error with SID generation

    Hi all,
    I have a problem loading a cyrillic string into a characteristic in a DSO.
    I get an error message when trying to activate the data in the DSO.
    The characteristic is a CHAR18 with the "lowercase letters" unmarked and there is an abap
    routine to convert the string in upper case.
    According to the error message, the string seems to be converted because the error shows the string in upper case ( the input was in lower case)  but the DSO data is not activated:
    " Value 'НЕУСТОЙКА 3498' (hex. '041D0415042304210422041E0419041A041000200033003400')
    of characteristic A2_ALLOCN contains invalid characters",
    I am working in an unicode system and I don´t know what is wrong...
    Any input will be highly appreciate it.
    Thanks in advance,
    Elena

    Value 'НЕУСТОЙКА 3498'
    Seems to be value contains invalid character.  Й
    If you need to populate invalid char into target  maintain this in t- code RSKC , Then system allows the Invalide chars into the target
    Donu2019t need edit this ivalue manually in PSA with required value and reconstruct from PSA.
    With Regards,
    Kishore.
    Edited by: Siv Kishore on Apr 22, 2009 11:37 AM
    Edited by: Siv Kishore on Apr 22, 2009 11:39 AM

  • Special character not being converted to upper case

    Hi all,
    I have an issue with special characters and upper/lower case.
    The character "ü" is in one of the values of an InfoObject and when loading we get an error message for this value. The character "Ü" is in RSKC, but still we are getting an error when loading.
    We are converting the values to upper case in the transfer rules, but this special character is not being converted to upper case...
    We start with the value "Heüringen" and after conversion we have the value "HEüRINGEN" where we want to have "HEÜRINGEN".
    Do you have any idea why this characer is not being converted?
    Any ideas are welcome!
    Best regards,
    TMV

    Hi Praveen,
    What does this module actually do? What kind of characters will the special chars be replaced with?
    Br,
    TMV

  • Editable ALV: Entered Values are not Converted to Upper Case

    Hi Experts,
    I'm getting stuck with this one...
    Fieldcat-lowercase is initial
    Associated domain is NOT "lower case"
    New values entered by user are not converted automatically to upper case and - in result - chek result of lower case value is "invalid"
    Must conversion be done manually?
    Thanks for your help!
    carsten

    1. You may not press enter key after the input data,
    2. You may get it field's fieldcat references different type. For exam x field like abc-f1. f1 type char 10.But your fieldcat dont use abc-f1 field.
      DEFINE BFCAT.
        CLEAR SFCAT.
        SFCAT-FIELDNAME = &1.
        SFCAT-TABNAME   = 'GT_ITAB_BUF'.    SFCAT-SELTEXT_S = &2.
        SFCAT-SELTEXT_M = &2.
        SFCAT-SELTEXT_L = &2.
        SFCAT-COL_POS   = COLPOS.
        SFCAT-REF_FIELDNAME = &3.
        SFCAT-REF_TABNAME = &4.   
        SFCAT-OUTPUTLEN = &5.
        SFCAT-NO_OUT = &6.
        COLPOS = COLPOS + 1.
        APPEND SFCAT TO TFCAT.
      END-OF-DEFINITION.
      COLPOS = 0.
      BFCAT 'ONRNO'       ''  'ONRNO'       'ZONR_DATA01_S01' '' ''.

  • Convert workarea content to upper case

    Hi experts,
    I have a work are which I  need to convert all its contents to UPPER CASE.
    is there a way i can do that without using TRANSLATE  for every field in that work area??/
    Thanks,
    Abdul.

    Hi Buddy,
    I tried for only one field and please do yourself for remaining fields .
    TYPES :BEGIN OF ls_tab1,
      field TYPE char200,
      END OF ls_tab1.
    DATA it_tab1 TYPE STANDARD TABLE OF ls_tab1 INITIAL SIZE 0.
    DATA lt_tab1 LIKE LINE OF it_tab1.
    lt_tab1-field = 'This is my first program to convert lower case to upper case  without using transalate syntax.....'.
    APPEND lt_tab1 TO it_tab1.
    READ TABLE it_tab1 INTO lt_tab1 INDEX 1
    IF sy-subrc EQ 0.
      WRITE lt_tab1-field COLOR 3.
    ENDIF.
    DATA :lv_counter TYPE i,
          uccp TYPE i,
          int TYPE i.
    LOOP AT it_tab1 INTO lt_tab1 .
      lv_counter  = STRLEN( lt_tab1-field ).
      WHILE int  NE lv_counter.
        IF lt_tab1+int(1)  EQ 'a' OR   lt_tab1+int(1) EQ 'b'  OR  lt_tab1+int(1) EQ  'c' OR lt_tab1+int(1) EQ  'd'
           OR lt_tab1+int(1) EQ 'e'  OR  lt_tab1+int(1) EQ 'f' OR lt_tab1+int(1) EQ 'g' OR lt_tab1+int(1) EQ 'h'
           OR lt_tab1+int(1) EQ 'i'  OR lt_tab1+int(1) EQ 'j' OR lt_tab1+int(1) EQ'k' OR lt_tab1+int(1) EQ'l' OR lt_tab1+int(1) EQ 'm'
           OR lt_tab1+int(1) EQ'n' OR lt_tab1+int(1) EQ 'o'   OR lt_tab1+int(1) EQ 'p'  OR lt_tab1+int(1) EQ 'q'
          OR lt_tab1+int(1) EQ 'r' OR lt_tab1+int(1) EQ 's' OR lt_tab1+int(1) EQ 't' OR lt_tab1+int(1) EQ 'u'
           OR lt_tab1+int(1) EQ 'v' OR lt_tab1+int(1) EQ 'w' OR lt_tab1+int(1) EQ 'x' OR lt_tab1+int(1) EQ 'y'
          OR lt_tab1+int(1) EQ'z'.
          CALL METHOD cl_abap_conv_out_ce=>uccpi
            EXPORTING
              char = lt_tab1+int(1)
            RECEIVING
              uccp = uccp.
          IF uccp BETWEEN 97 AND 122.
            uccp = ( uccp - 32 ) .
    *        TRY.
            CALL METHOD cl_abap_conv_in_ce=>uccpi
              EXPORTING
                uccp = uccp
              RECEIVING
                char = lt_tab1-field+int(1).
          ENDIF.
        ENDIF.
        int =  int + 1 .
      ENDWHILE.
      MODIFY it_tab1 FROM lt_tab1 .
    ENDLOOP.
    write: 'After converting to upper case'.
    READ TABLE it_tab1 INTO lt_tab1 INDEX 1
    IF sy-subrc EQ 0.
      WRITE lt_tab1-field COLOR 3.
    ENDIF.
    Please let me know further any issues .
    Thanks
    Surender

  • How to convert a text file in lower case to upper case?

    I've a beginner in java world and I just come through the tutorial in http://java.sun.com/docs/books/tutorial/essential/io/filestreams.html showing how to copy a text file:
    import java.io.*;
    public class Copy {
    public static void main(String[] args) throws IOException {
         File inputFile = new File("farrago.txt");
         File outputFile = new File("outagain.txt");
    FileReader in = new FileReader(inputFile);
    FileWriter out = new FileWriter(outputFile);
    int c;
    while ((c = in.read()) != -1)
    out.write(c);
    in.close();
    out.close();
    And I would like to ask how to covert all lower case letters in input file to upper case letter in output file at the same time of copying.
    I guess it'll be using Character.toUpperCase(c), but I don't know how to do it actually.
    Any help would be much appreciated.

    Hope this helps
    import java.io.*;
    public class Copy {
    public static void main(String[] args) throws IOException {
    File inputFile = new File("farrago.txt");
    File outputFile = new File("outagain.txt");
    FileReader in = new FileReader(inputFile);
    FileWriter out = new FileWriter(outputFile);
    BufferedReader buff = new BufferedReader(in);
    String c;
    while ((c = buff.readLine()) != null)
    out.write(c.toUpperCase());
    in.close();
    out.close();
    }

  • Submit report - problem in upper case

    Hi Experts,
    I need to submit RCSBI040 in my report and pass the file value from my report to RCSBI040. The thing is the file value goes with upper case.But i need to send what the value am giving that value only go to RCSBI040 field filename.
    Please can you help me out.
    Thanks in advance...
    Regards,
    R P R Kumaar.

    Hello,
    Does it really matter...   Even if u enter in lower case it will be converted to upper case
    check this by executing program  RCSBI040 and enter some path and press enter.. You will see that it gets converted to upper case.
    Enjoy SAP,
    Pankaj

  • How to cast a fieldinput value to upper case.

    Im not a java programer I guess that this must be a silly thing.
    Im searching data in R/3 from 2 fields 1 numeric and the other alphanumeric. This alphanumeric fields if I put it in upper case works, if I wirte it in lower case doesnt works.
    In R/3 when I test the FM doesnt matter if I put it lower or upper case, it works fine.
    so I wanna know how can I in WD cast the value that I put in that fieldinput be converted to upper case when I hit the search button.
    Thx

    > Im not a java programer I guess that this must be a
    > silly thing.
    >
    > Im searching data in R/3 from 2 fields 1 numeric and
    > the other alphanumeric. This alphanumeric fields if I
    > put it in upper case works, if I wirte it in lower
    > case doesnt works.
    >
    > In R/3 when I test the FM doesnt matter if I put it
    > lower or upper case, it works fine.
    >
    > so I wanna know how can I in WD cast the value that I
    > put in that fieldinput be converted to upper case
    > when I hit the search button.
    >
    > Thx
    Hi,
    When you test the FM in SE37 in R3 there is an option at the top of the screen Called Uppercase/Lowercase - this controls whether the input is automatically converted to upper case for alphanumeric fields.
    The other option you have, if it is a custom FM, is to translate the input of the alphanumeric fields in the ABAP - it is quite common to have to translate or convert input data to make sure it is in the same format as the backend system.
    I prefer to do this sort of conversion on the backend system as usually you have a better guarentee that it will be in the correct format, than if you do it in the Java element.
    Just my opinion,
    Gareth.

  • Translate to upper case a structure in ecc 6.0

    Hi,
    How to translate to upper case a structure in sys:ecc 6.0 (unicode) like it was possible in sys:4.7
    TRANSLATE s_tab TO UPPER CASE.
    now I have an error message: "s_tab shall be a character-type".
    thanks

    Hi,
    The usage of the method to convert codepages of structures is described including this code sample:
    DATA:BEGIN OF struc,
    text(5) TYPE c,
    int TYPE i,
    END OF struc.
    DATA:buffer TYPE xstring,
    conv TYPE REF TO cl_abap_conv_out_ce,
    view TYPE REF TO cl_abap_view_offlen.
    view = cl_abap_view_offlen=>create_legacy_view( struc ).
    conv = cl_abap_conv_out_ce=>create(
    encoding = '0120'
    endian = 'B' ).
    struc-text = 'Abc12'.
    struc-int = 65538.
    conv->convert_struc( EXPORTING data = struc
    view = view
    IMPORTING buffer = buffer ).
    Regards,
    Satish

Maybe you are looking for

  • TS3899 How do i delete multiple emails at one time on I phone 4

    How do i delete more than 1 email at a time

  • Apps keep turning cellular data on

    I keep turning off data for most of my apps so that I can only use them on wifi but lately some pass keep turning their cellular data on. I try to turn it off again but they always manage to turn it back on after I leave my settings

  • Java client failing to connect to web service - help!!

    Hi I have created a Web service using ASP Web Matrix, which currently resides on my C drive in c:\Service6\HelloWorld.asmx. The service can be tested from a browser on my local machine by calling: http://localhost/Service6/HelloWorld.asmx. This works

  • Want to upgrade to SL, but need IMOVIE 06

    Hi all...Okay... I am using OS X (10.4.11), I know I need to upgrade and want to upgrade to Snow Leopar. Here's my problem..I am transferring 8mm films to my digital camcorder,then importing to IMOVIE08, then to IDVD to burn onto a dvd. The quality o

  • My apps won't quit or re-open

    All of a sudden yesterday my applications started to not quit. I couldn't actually use the apps, the appeared closed, but they still showed as open in the dock and the force quit menu. It wouldn't let me open them again to use them so I had to manual