Deleting last character of a string

Hi Abapers,
I want to delete the last character of my workarea and then store into table.
The workarea says that it is FAX|
I have to remove the last character.
How to do tht.
Please reply.
Thanks

hi
do this in following way
frist find the String length
let it will be
w_str = 'sdn is wonderfull'
now use.
w_len = strlen(w_str) .
now
w_result = w_str+0(w_len - 1).
Cheers
Snehi

Similar Messages

  • How to delete last character in a string

    Guys i have a question...
    how can i delete the last character in a string..
    for example
    String myString = "helloWorld, ";
    how do i delete the last character in this string which is a "," ?

    String newString = myString.substring(0, myString.length()-1);

  • Truncating last character in a string

    I am making a dialpad. It is just for display so I am using a
    string for the numbers selected. I am trying to make a back button
    that would clear the last number added. I tried mystring.length-1
    but that doesn't seem to be doing the trick. Is there a simple way
    to truncate the last character in a string, of variable
    length??

    Here's an example
    var someStr="asdfasdf saf asdf sadfas dfs fsa asf";
    while (someStr.length) {
    someStr = someStr.substring(0,someStr.length-1)
    trace(someStr);
    }

  • How we can find the last character in a string(Urgent Plz!)

    Gurus!
    How we can find the last character in a string.
    e.g i have a string say "Str" with value "10-01".
    Now i want to find the last character in "Str" i.e "ONE=1".
    i am using Oracle developer 6i with Oracle 8i(1.7).
    Plz help!
    Many thanks!

    Use the substr() and length() functions -
    x := '10-01';
    y := substr(x, length(x));

  • Testing the last character of a string using .endsWith

    Hi,
    I want to check to see if the last character of a string is '@'.
    I tried if (StringAt.endsWith("a")) {
    but got no results.
    Is this the correct way to do it or is there another way.
    Thanks.
    Adam

    javadocs:
    String's endsWith method takes a string argument.
    endsWith
         public boolean endsWith(String suffix)
              Tests if this string ends with the specified suffix.
              Parameters:
                   suffix - the suffix.
              Returns:
                   true if the character sequence represented by the argument is a suffix of the character sequence
                   represented by this object; false otherwise. Note that the result will be true if the argument is the
                   empty string or is equal to this String object as determined by the equals(Object) method.
              Throws:
                   NullPointerException - if suffix is null.

  • LAST CHARACTER OF A STRING

    Hi Gurus,
    I want to get the last character of a String.For Ex.
    I have name = 'ZXCDFG":?'
    And I want to print the last character ?.
    How can i do it.
    Thanks in Advance.

    Hi Pradeep,
    Just find the String Length and use the offset commands
    DATA : DATA TYPE CHAR20 'ABCDEFG',
    DATA : DATA1,
    DATA : LEN TYPE I.
    LEN = STRLEN( DATA ).
    LEN = LEN - 1.
    DATA1 = DATA+LEN(1).
    Regards
    Kumar M.

  • To delete first and last character of a string???

    Hi Everybody !!!
    Do you know a method that can permit to delete in a string the first and the last character?
    For instance I have in my string this word : [the word]
    I would like to delete the '[' and the ']' character.
    Is exist a method that permit to delete this character?
    Thanks !!!

    Look at the substring method of the String class.
    Note that since string is immutable, you'll need to assign the results of substring to a variable (could be the same as the original or different).

  • Deleting last char in a string...

    I have a string that is created as follows: strBuffer += k.getKeyChar();(k is KeyPressed ...KeyEvent) How can I delete the last Char in the string strBuffer?

    Hi
    // simply substring
    if (strBuffer.length() > 1)
        strBuffer = strBuffer.substring(0, strBuffer.length()-1);
    // you may also use
    if (strBuffer.length() > 1)
        StringBuffer buffer = new StringBuffer(strBuffer).
                                   deleteCharAt(strBuffer.length()-1);
        strBuffer = buffer.toString();
    }I've not tested the above code myself & I've written the above code on the go after reading your query. The above code definitely work & help you.
    Regards,
    JPassion

  • Want to single out the last character of a string

    There is a field where there are many strings of varying length. E.g.: AB001XUV, AB003XUK, DJ8933FXUV etc.
    From these strings I need to create a virtual column where only the last character is shown. So it shall be V, K, V for values from the above example.
    Can anyone please suggest me how to achieve this.
    Regards
    Hawker

    SQL> with t as (
      2  select 'AB001XUV' col from dual
      3  union
      4  select 'AB003XUK' col from dual
      5  union
      6  select 'DJ8933FXUV' col from dual
      7  )
      8  select substr(col,-1,1) from t
      9  /
    S
    V
    K
    V
    SQL> create table temp(id number,
                      col varchar2(10),
                      VIRTUAL_COL VARCHAR2(1)   GENERATED ALWAYS AS (substr(col,-1,1)) VIRTUAL
    SQL> insert into temp(id,col) values(1, 'AB001XUV') ;
    SQL> select * from temp ;
            ID COL        V
             1 AB001XUV   V
    SQL> Edited by: Azhar Husain on Aug 16, 2011 1:17 PM

  • Removing last character of a string

    Hi Gurus,
                 Is there any way to remove the last character of staring other that finding the string length and doing it?
    waiting for reply
    Ravi

    HI,
    yaa u can do this by one logic
    wht u do is concatenate one special symbol like $ to the string wht u have and in the next statement by using tht special symbol u can find fdpos i.e. field postion i.e. at which lenght it is there and then in again another statement u can increa fdpos by one and u can cut the string at tht length
    i think u got my logic
    further if u have any quiries u can contact me on [email protected]
    plzz reward if it is usefull....

  • Select last character of a string

    Hello,
    I would like to select the last character of an address string. For example, in '165 John Ave W' -- select result 'W'. I tried to use RIGHT but it doesn't work. I'm using SQL Plus.
    SELECT RIGHT(ADDRESS,1) FROM addresses;
    ORA-00904: "RIGHT": invalid identifier
    I can't find the appropriate select statement to achieve the result I want. Ideas?
    Thanks!

    The SUBSTR function can take a negative start parameter, which counts in from the end of the string
    http://www.techonthenet.com/oracle/functions/substr.php - that should get you going, let me know if you get stuck.
    Carl

  • The last character of a string

    How to judge the last char of a string is " ?
    if (s.endsWith("""))or
    if (s.endsWith("/""))

    bet
    you just copied and pasted what the OP had written
    and quickly put that
    backslash in, hit post without previewing first just
    to make me look like
    a slow old sod! It's not fair ;-)
    kind regards,
    JosNope, I used the Alt-[numeric code] combinations to manually type each character. Cut-n-paste is for wimps, and actually typing single-stroke keys is for milquetoasts.
    Alt-[numeric code] is for real men ;-)

  • For Loop - Deleting Last character

    When I type: java Commands -all one two three
    the result is: one,two,three,
    How can I remove the last comma?
    This is my program. Somebody told me to try a substring by I cannot seem to figure it out.
    public class Commands{
    public static void main(String[] args){
    if(args.length!=0){
    if(args[0].equals("-all")){
    for(int i=1;i<args.length;i++){
    String a=(args[i]+",");
    System.out.print(a);
    }//for
    }//if all
    }}

    or
    if (args.length > 0 && args[0].equals("-all") ) {
    System.out.print( args[1] );
    for (int i=2;i<args.length;i++) {
    System.out.print(", " + args);
    Jim

  • Any easier way to replace the last character of a string?

    this is what I got:
    select SUBSTR('tjgb005dy_01_31_08',1,LENGTH('tjgb005dy_01_31_08')-1)||'1' from dual;
    tjgb005dy_01_31_01and I am not quite fond of it. it looks ugly and it is long.
    so, I wonder if you guys have better ideas?
    Thanks

    (Perhaps with replace there is no easier solution than the primary posted.)Well, look where I ended up...
    SQL> -- generating sample data:
    SQL> with t as ( select 'tjgb005dy_01_31_08' str from dual union
      2              select 'tjgb005dy_01_31_03' from dual union
      3              select '888888888888888888' from dual
      4            )
      5  --
      6  -- actual query
      7  --
      8  select str
      9  ,      case
    10           when substr(str, -1) = 8
    11           then
    12             substr(str, 1, length(str)-1)||'1'
    13           else
    14             str
    15         end
    16  from t;
    STR                CASEWHENSUBSTR(STR,-1)=8THENSU
    888888888888888888 888888888888888881
    tjgb005dy_01_31_03 tjgb005dy_01_31_03
    tjgb005dy_01_31_08 tjgb005dy_01_31_01Now I'm going to stay at the coffee-machine for the rest of the day... ;)

  • Looking for the last item in a string set in a particular character style

    I should find each space that is the last character in a string set in a particular character style. For example, in the passage "123 456 789" (the underlined part here indicating a passage set in a particular character style), my ideal GREP search would yield a match after the digit 6.
    How do this?

    Excellent! This works perfectly. I have used your string with the bold character formatting, and replaced the matches with [nothing], set in None style.
    On second thought, I was surprised that it indeed had worked: why was the space replaced, and not deleted? Shouldn't I have used
    (?<!.)(\s)(?=\w)
    and replaced it with
    $2

Maybe you are looking for

  • Problem comparing one line of a file to a different line

    Hey guys, i have a list of emails with a bunch of duplicates and i want to have one of each address. The logic behid the program is it would read in the first email, see if its in the second email list. If the email isnt in the new list it would prin

  • High level & low level Desing in OBIEE

    Hi Gurus/Experts, I am new to in OBIEE and please let me know about the High Level and Low level design of obiee projects. Really its helpful for me to develope my carrier skills. Thanks in advance, Sriram

  • Cannot open Olympus OM-D E-M5 Raw files in CS6. [was:camera raw?]

    I am trying to open ORF raw files, but PS6 can't open them.  I am at Camera raw 7 and the update file says I am fully updated.  There are higher versions but I don't know how to access them.

  • Incomplete items in Catalog. Only completed items were transferred.

    Hi all, i have a problem related to Shopping Cart. When I select an item from  my catalog in order to add it to my Shopping Cart, I have that error message:"Incomplete items in Catalog. Only completed items were transferred." I checked UOM but there

  • My iPod is disabled for over 22 million minutes

    I have an iPod which my son has forgotten his password during the time he lost his iPod. In any event, his brothers all thought it would be cool to Ty and figure it out....but ended up disabling the iPod for over 22 million minutes. Is there some way