Ascii value of a non numeric string  literal

hi,
i would like to get the ascii value of a non numeric string
having special characters from extended ascii set.
for example i have a user id "J��o M��" and i want to get the ascii value of each character in this string.
(There are special characters having ascii value more than 127, present in string literal)
if you know some methods to do that ??
thanks

Use charAt(i) to give you each char in the string. A char is also the numeric value of the character: note that there's no such thing as "extended ASCII" -- ASCII is the first 128 characters of Unicode, and Java uses Unicode characters.
String str = "Hello";
for (int i = 0; i < str.length(); i++)
    System.out.println((int) str.charAt(i)); // cast to int so the char is displayed as a number

Similar Messages

  • Getting non numeric strings using regular expression

    Hi Guys ,
    I  want to get list of string values in table which contains no numeric values  .....
    I have a   string column name A and table name B  .
    I have written following code , but it seems it is incorrect  .
    Plz help me out  .....
    SELECT
    A FROM
    B
    WHERE
    regexp_like(A, '([^[:digit:]])'
    Thanks in advance ....

    96097f0e-f165-463a-a0a2-3d15214c8a3d wrote:
    Hi Guys ,
    I  want to get list of string values in table which contains no numeric values  .....
    I have a   string column name A and table name B  .
    I have written following code , but it seems it is incorrect  .
    Plz help me out  .....
    SELECT
    A FROM
    B
    WHERE
    regexp_like(A, '([^[:digit:]])'
    Thanks in advance ....
    That will give you every one that has at least one non-numeric character, if you want ones which contain no numeric characters then it should be
    regexp_like(A,'^[^0-9]*$')

  • Non-numeric String formatting

    Ok, I understand about numeric string formating (NumberFormat). But what I need help with is string formatting.
    For example, I'm working on an app with fixed-length records. Let's take a name field. I need the string "John Doe" formatted to a 40-character field, right-justified. Can someone point me to a class or a URL with information on this.
    Sorry for asking such an elementary question.

    Ok, I understand about numeric string formating
    (NumberFormat). But what I need help with is string
    formatting.
    For example, I'm working on an app with fixed-length
    records. Let's take a name field. I need the string
    "John Doe" formatted to a 40-character field,
    right-justified. Can someone point me to a class or a
    URL with information on this.In the JDK I found nothing, but in the jakarta-Projekt of apache.org:
    http://jakarta.apache.org/commons/lang.html
    There is a class called StringUtils.
    You only have to write:
    String rightJustified = StringUtils.rightPad("John Doe", 40);
    If you don't find something in the JDK look at Jakarta. They have a lot of useful stuff.

  • ALV WebDynpro Hierarchy -Setting non-numeric values in the header level row

    Hi Experts,
    When setting up an ALV table as a table hierarchy the standard ALV settings only seem to allow for numeric values to be displayed in the higher hierarchy levels. Is there a way to also set the values for some non-numeric columns into these higher-level rows - programmatically or through the ALV Settings?
    Example: I have delivery item level data in my context and the delivery number as a hierarchy column. Some columns in my context however actually come from the delivery header e.g. delivery block, delivery priority, ship-to etc and I would like to display these in the collapsed header rows of the delivery number.
    It seems obvious to me that this should be doable otherwise if you are looking at at a list of hundreds of deliveries and all you see besides the delivery number is numeric data such as sums & totals, it's kind of hard to know which delivery you might want to expand the sub-level for.
    Please help,
    Peter

    Hi,
    Even we have faced the same issue.
    In ALV hierarchy, we cannot display data at header items/levels. this is a constraint in ALV. You can achieve the same usign TABLE UI element.

  • Script to replace non-numeric value of column to blank

    Hi
    I want to replace non-numeric value of column to blank. Can any one help me out.
    For example:
    column1
    234 kjnkj 12e
    555565asd44
    1232334343
    Now I want to that update cloumn with blank value which contains non-numeric value in it

    Try the following
    select translate(column1,translate(column1,' +-123456789',' '), ' ') b from dual;                                                                                                                                                                                                           

  • Build a querystring within class file throws js unterminated string literal

    Hello all,
    I have a page that is partially built from within a method.
    String theLink ="FeedFilePusher";//My servlet
                        itemGeoLink = "<a href='#' onclick=top.alertMe('"+theLink+"')>CLICK</a>";The above works fine.
    The problem is that I need to pass a querystring to this servlet.
                        String theLink ="FeedFilePusher?title=" + itemTitle + "&summary=" + itemDesc + "&link=" + entry.getLink() + "&updated=" + itemDate;
                        itemGeoLink = "<a href='#' onclick=top.alertMe('"+theLink+"')>CLICK</a>";When I add the querystring values it throws a unterminated string literal error from within firefox.
    I tried to encode the ? and the & but that didnt work.
    Any ideas on how to do this?
    Here is the simple javascript function called alertMe.
    function alertMe(url)
        document.getElementById('mapframe').src = url;
        closeBubble();
    }TIA!

    Check if the resulting link has any ' or accented letters (����). That sometimes causes that error (at least i've seen it like.. 1000000 times writing spanish applications lol)
    Also, the URL.encode() method might help.

  • Non numeric value in numeric field giving error

    Hi All
    I am using BAPI for creating sales order. If user is giving non numeric value in Quantity field it is giving error. Because quantity field data type is Double.
    Please Help.
    Thanks
    Raktim

    Hi Banerjee,
                 Create a String/int/long Context variable and point it to UI Input element.Do the validation  for correct input value. once the validation is succesful assign that value to RFC BigDecimal variable by Explicit casting.
    Hope this might solve your problem .
    Thanks
    Madhan

  • How to check non-numeric value in a field

    Hi all,
    I have a field 'MVALUE'. HOw can I check if I have a non-numeric value in my field. Let us say if I have a value '<25' in this field. How can I check if the value in this field is non-numeric. The field MVALUE is of CHAR datatype.
    Please help. Waiting.........

    Might have to add a space in the string...
    if not mvalue co ' 0123456789'.
    * error
    endif.
    if you allow decimals and commas...
    if not mvalue co ' .,0123456789'.
    * error
    endif.

  • Replace Non-Numeric Characters with a Numeric Character in a String

    Hi Guys,
    I need to replace all the non-numeric characters (including embedded blanks & hyphen) in a string to a numeric character '1'.
    The trailing blanks should not be replaced.
    e.g. "P22233344455566" should be changed to "122233344455566"
    &    "49-1234567           " should be changed to "4911234567          "
    Please help.

    Use [replace|http://help.sap.com/abapdocu_70/en/ABAPREPLACE_IN_PATTERN.htm] with a regular expression to translate any non-numeric character (i.e. any character not between 0 and 9) to 1:
      REPLACE ALL OCCURENCES OF REGEX '[^0-9]' IN value WITH '1'.
    Cheers, harald
    p.s.: In older releases [translate|http://help.sap.com/abapdocu_70/en/ABAPTRANSLATE.htm] would also do the trick, but is more lengthy, because one would need to specify each individual character that should be replaced, e.g.:
      TRANSLATE value TO UPPER CASE.
      TRANSLATE value USING
          ' 1_1-1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1'.

  • Unicode value of a non-ASCII character

    Hi,
    Suppose, the unicode value of the character &#2381; is '\u094d'.
    Is there any Java function which can get this unicode value of a non-ASCII character.
    Like:
    char c='&#2381;';
    String s=convertToUnicode(c);
    System.out.println("The unicode value is "+ s);
    Output:
    The unicode value is \u094d
    Thanks in advance

    Ranjan_Yengkhom wrote:
    I have tried with the parameter
    c:\ javac -encoding utf8 filename.java
    Still I am getting the same print i.e. \u3fIf it comes out as "\u3f" (instead of failing to compile or any other value), then your source code already contains the question mark. So you already saved it wrong and have to re-type it (at least the single character).
    >
    Then I studied one tutorial regarding this issue
    http://vietunicode.sourceforge.net/howto/java/encoding.html
    It says that we need to save the java file in UTF-8 format. I have explored most of the editors like netbean, eclipse, JCreator, etc... there is no option to save the java file in UTF-8 format.That's one way. But since that is so problematic (you'll have to remember/make sure to always save it that way and to compile it using the correct switch), the better solution by far is not to use any non-ASCII characters in your source code.
    I already told you two possible ways to achieve that: unicode escapes or externalized strings.
    Also read http://www.joelonsoftware.com/articles/Unicode.html (just because it's related, essential information and I just posted that link somewhere else).

  • Removing non-numeric characters from string

    Hi there,
    I need to have the ability to remove non-numeric characters from a string and I do not know how to do this.
    Does any one know a way?
    Example:
    Present String: (02)-2345-4607
    Required String: 0223454607
    Thanks in advance

    Dear NickM
    Try this this will work...........
    create or replace function char2num(mstring in varchar2) return integer
    is
    -- Function to remove Special characters and alphebets from phone no. string field
    -- Author - Valid Bharde.(India-Mumbai)
    -- Date :- 20 Sept 2006.
    -- This Function will return numeric representation.
    -- The Folowing program is gifted to NickM with respect to his post on oracle site regarding Removing non-numeric characters from string on the said date
    mstatus number :=0;
    mnum number:=0;
    mrefstring varchar2(50);
    begin
    mnum := length(mstring);
    for x in 1..mnum loop
    if (ASCII(substr(upper(mstring),x,1)) >= 48 and ASCII(substr(upper(mstring),x,1)) <= 57) then
    mrefstring := mrefstring || substr(mstring,x,1);
    end if;
    end loop;
    return mrefstring;
    end;
    copy the above program and use it at function for example
    SQL> select char2num('(022)-453452781') from dual;
    CHAR2NUM('(022)-453452781')
    22453452781
    Chao!!!

  • Find a non-numeric character in a string

    I have a 3 strings (1) 'AB99CDEFGH0012%' (2) 'ABCDEFGH' (3) 'ABCD11'
    how do i find out a that string has non numeric characters
    Thanks

    SELECT TO_NUMBER(:String) FROM DUAL;
    is a quick way to find out :)
    A good method would be.....
    SELECT 1 FROM DUAL WHERE TRANSLATE(:String, 1234567890, '-') IS NOT NULL;
    The statement will filter out ALL numbers, leaving behind any characters, A, B, @, ~, etc...

  • Removing Non-numeric characters from Alpha-numeric string

    Hi,
    I have one column in which i have Alpha-numeric data like
    COLUMN X
    +91 (876) 098 6789
    1-567-987-7655
    so on.
    I want to remove Non-numeric characters from above (space,'(',')',+,........)
    i want to write something generic (suppose some function to which i pass the column)
    thanks in advance,
    Mandip

    This variation uses the like operators pattern recognition to remove non alphanumeric characters. It also
    keeps decimals.
    Code Snippet
    CREATE FUNCTION dbo.RemoveChars(@Str varchar(1000))
    RETURNS VARCHAR(1000)
    BEGIN
    declare @NewStr varchar(1000),
    @i int
    set @i = 1
    set @NewStr = ''
    while @i <= len(@str)
    begin
    --grab digits or (| in regex) decimal
    if substring(@str,@i,1) like '%[0-9|.]%'
    begin
    set @NewStr = @NewStr + substring(@str,@i,1)
    end
    else
    begin
    set @NewStr = @NewStr
    end
    set @i = @i + 1
    end
    RETURN Rtrim(Ltrim(@NewStr))
    END
    GO
    Code to validate:
    Code Snippet
    declare @t table(
    TestStr varchar(100)
    insert into @t values ('+91 (8.76) \098 6789');
    insert into @t values ('1-567-987-7655');
    select dbo.RemoveChars(TestStr)
    from @t

  • Non-numeric values in analog I/O points

    I have a system with a FP-3000 controller and a series of TC-120 and RLY-420 modules. At various times I am receiving erros for non-numeric values in some of the analog I/O points. The value, as stated by Ni-FIBUS is "-1.#IND".
    Does any one know what this is? Also once this value appears, It is impossible to get rid of it. The function must be completely deleted and re made from scratch.

    Some general suggestions:
    1. Settings of Function Blocks do not match the real input values, such as type mismatch. You need to verify the value data and type.
    2. Invalid Scaling settings, the units of parameters between connecting function blocks may not match. Please check the block input and output.

  • Non-Numeric Values in Appraisal Template

    All,
    I wanted to know if these are possible
    1) How we can make the columns to accept the non-numeric characters. Currently it only accepts the numeric.
    2) How can we make the columns blank - Current it always shows "0.0" - for eg.
    Please see the screen shot here
    http://img600.imageshack.us/img600/8420/appraisal.jpg
    Aneez

    >
    Hire to Retire GT Project wrote:
    > All,
    >
    > I wanted to know if these are possible
    >
    > 1) How we can make the columns to accept the non-numeric characters. Currently it only accepts the numeric.
    >
    > 2) How can we make the columns blank - Current it always shows "0.0" - for eg.
    >
    > Please see the screen shot here
    >
    > http://img600.imageshack.us/img600/8420/appraisal.jpg
    >
    >
    > Aneez
    Hi Aneez,
    for free text input.
    I control by making the column = "no entry", but than enabling the notes field.  The other advantage to the notes field is you can easily control the length of the text box in the config. 
    for value input you just need to configure the value class.

Maybe you are looking for

  • Some faqs can u solve dis answers asp

    1) How do u handle table control in bdc? 2) What is diff b/w normal functional modules and BAPI's fm's? 3)what is fct-code of at- line- selection? 4)why do u  use subroutine pool in scripts? 5)name few performance techniques? 6)in how many ways u can

  • IPod Classic 120GB freezes, won't add more songs

    Hi Guys! I was wondering if anyone can help me, I've been reading through some posts and it seems some people may have the same problem as me. A friend of mine kept my iPod plugged in and was transferring all my music onto her Macbook pro, and I'm no

  • Hello i have a problem when i start woorksheet, my computer crash with blue screen sometimes.

    hello i have a problem when i start woorksheet, my computer crash with blue screen. OS: Win 2000 pack 2 and dasylab 7.00.05 ;ddi7.02 ;nidaq 7.0 I hve this problem sometimes and need to reebot my computer.This worksheet is used to generate 4 signals t

  • Alarm not working. cannot set/create new

    I have an iphone 5c running 8.0.2 I was having issues with sending text messages so I looked up similar problems and ended up having to reset network settings. this resolved the issue with the text messages but now I cannot set/create new alarms and

  • Not receiving IP from DHCP

    I have (2) networks going into an ap 1200 - the AP has a static ip set on it as 192.168.199.210 which is vlan 20 the other network is from my DSL to have wide open wireless for guests (vlan100) that ip in the router is set at 192.168.199.51 (scope is