Getting the last token

Hi !
Is it possible to get not the next but the last token ? I want to go through a tokenizer array and I need the next but one token. thats why i want to reset the tokenizer array pointer once if i got the next but one token. is it possible ?
the problem is that i want to get the next but one token only (!) if a previous token has a special content.

Try String.split(), then you can implement yourown
traverse mechanism.Yes, it is the best method.
String m = "This is beneficial";
String[] s = String.split(" ");
String lastToken = s[2]; 
System.out.println(lastToken) ; 
Sorry for the wrong codes.
The modified codes:
String m = "This is beneficial";
String[] s = m.split(" ");
String lastToken = s[2]; 
System.out.println(lastToken) ;  Sorry again...

Similar Messages

  • How to get the last revision quote to SSRS report

    HI,
    My report current result like this
    Qoute ID
    Revision
    Q1
    1
    Q1
    2
    Q1
    3
    Q2
    1
    Q3
    1
    I would like to filter if the quote ID is same , only get the last revision quote into report
    Qoute ID
    Revision
    Q1
    3
    Q2
    1
    Q3
    1
    How can i compare the Quote ID and Revision in fetchxml or dataset filter ?
    Thank You

    <fetch distinct='false' mapping='logical' aggregate='true'> 
        <entity name='Quote'> 
           <attribute name='revisionnumber' alias='estimatedvalue_max' aggregate='max' /> 
           <attribute name='quotenumber' alias='quoteid' groupby='true' /> 
        </entity> 
    </fetch>"
    Regards, Saad

  • Getting the "last modified" property of a file located on HTTP server

    Hello
    I'd like to read a file (on http server) according to his "last modified" time. Can anybody tell me how to get the "last modified" property in a J2ME/CLDC application?
    Thanks in advance

    the file that you want get is in the server?
    you can use java.io.File.lastModified() which in J2SE to get a long num.
    then you can transform long int to orther class that you need ,and do this in server.
    at the end of all you can send this info to J2ME/CLDC app with stream.

  • How to get the device token in windows phone 8 sliverlight application?

    Hi,
    I am developing a windows phone 8 silverlight application . For my application I want to add push notification service , for this service I have to call one web service in my app . This api requires device token , device id ..etc , I am able to get the all
    the things except devicetoken .
    How to get the device token of a device ?
    any help?
    Thanks...
    Suresh.M

    Most probably device token is the push channel url which is returned by MPNS when a request is made to it.
    Step 3 here: Push notifications for Windows Phone 8
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • Need to query the database to get the last sequence number

    Hi all
    I am trying to get the last sequence number of the last row inserted into my Oracle database. Please could someone give me the SQL which would allow me to do this - using Oracle SQL Explorer I have confirmed that there is a sequence on the table which is called: XYZ_SEQ and the code for this is:
    CREATE SEQUENCE "MY_USER_NAME"."XYZ_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 21 CACHE 20 NOORDER NOCYCLE ;
    My Java application is inserting a row into my table and to insert a new row I need to have the last sequence inserted +1 so the new row can be added.
    Any help would be much appreciated.

    Hi,
    Welcome to the forum!
    If you are using a sequence just do (example):
    INSERT INTO TABLE_NAME
       (COL1,
        COL2)
    VALUES
       (SEQUENCE_NAME.NEXTVAL,
        OTHER_VALUE);to obtain (and use) the next number in the sequence when you are inserting.
    If you have a sequence to use for a specific table, you should use it when your insert new data (no matter your are doing that: java application, procedure, etc). Doing this you avoid some problems when you have the sequence 'out of date' about the associated data.
    Regards,
    Edited by: Walter Fernández on Sep 19, 2009 10:08 AM
    Edited by: Walter Fernández on Sep 19, 2009 10:10 AM

  • How to get the Last cell in HSSFCell (Excel sheet)

    Hello
    I am trying to convert an excel sheet to a tab limited file.
    I am using HSSF and unable to track how do i know if the cell encountered is a last filled cell in excel sheet
    Some of the cells in the sheet can be blank. In that case i am just using inputting a '\t' for that cell and read the next one. But coz of this when i get the last cell, a tab is included for that too.
    Can someone let me know how can i rectify this?
    it seems like HSSFCell does not have any methos like lastCell or so
    Thanx

    then use getLastCellNum() in org.apache.poi.hssf.usermodel.HSSFRow

  • How to get the last value edited by users from JTable?

    Hi.
    I have a JDialog that includes an editable JTable. This table is used to set up field caption and font for a report program. I found only when cursor is moved to another cell, the value in current cell being edited will be transferred to Table Model. So if the user don�t move cursor to another cell after editing the value of a cell but click OK button directly, Table Model cannot get the last value edited by the user, I wonder if there is a way to fire JTable to transfer the value being edited to Table model.
    By the way, I found if the TableCellEditor is using JCheckBox or JComboBox instead of JTextField, there is no this problem.
    Thank you for any reply.

    I guess you can make use of the following methods on your table model to inform it make it getValueAt bcos table data has changed.
    fireTableCellUpdated
    Notifies all listeners that the value of the cell at [row, column] has been updated.
    fireTableChanged
    Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model.
    fireTableDataChanged
    Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and the JTable should redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same.
    But when to call these methods??
    -- When OK button is pressed, do this as the first thing!!
    OR
    -- Call this on every key event!!
    regds,
    CA

  • How to Get the last data dymanic

    in my bussiness scenarios,I have a cube store some data by month
    but some material have no records in some month
    I need to check if this month have records,get it
    or if there is no records, get the last records by month
    how can i do this?

    You check in R3...whether you have material data for that month...if yopu have data, in BW, run a repair full request by giving this criteria i.e. month criteria.
    Thanks...
    Shambhu

  • How to get the last element of a structure in a textfield in DesignStudio

    Hello,
    how can I get the last element of a structure within a bex query?
    Within the structure we are working with dates that dynamically are buiId (input date - offsets for several months).
    I have to show the last value in a single textfield within DesignStudio.
    Regards
    Frank

    Hi Frank,
    in DS 1.3 you can use forEach function to get the last element of BEx structure (or n-th element in general using if condition)
    var array = DS_CROSSTAB1.getMembers("DHGY5D6XEFO1K45SB00BXFH7A",10);
    var lastMember="";
    array.forEach(function(element, index) {
           lastMember = element.text;
    TEXT_1.setText("Last structure element: "+lastMember);

  • How to get the last series of an invoice- DebitMemo

    Hi,
    I need help to know how I can get the last series number of an Invoice with documentsubType = bod_DebitMemo. I can get the las series number of Invoices with the following code:
    private int getSeries(string documento)
                SAPbobsCOM.CompanyService oCompServ;
                SAPbobsCOM.SeriesService oSeriersService;
                SeriesCollection oSeriesCollection;
                Series oSeries;
                DocumentTypeParams oDocumentTypeParamas;
                int elAnterior = 0;
                try
                    //Get company service
                    oCompServ = vCmp.GetCompanyService();
                    //Get series service
                    oSeriersService = (SAPbobsCOM.SeriesService)oCompServ.GetBusinessService(ServiceTypes.SeriesService);
                    //Get series collection
                    oSeriesCollection = (SAPbobsCOM.SeriesCollection)oSeriersService.GetDataInterface(SeriesServiceDataInterfaces.ssdiSeriesCollection);
                    //Get document type params
                    oDocumentTypeParamas = (SAPbobsCOM.DocumentTypeParams)oSeriersService.GetDataInterface(SeriesServiceDataInterfaces.ssdiDocumentTypeParams);
                    //Set document type
                    oDocumentTypeParamas.Document = documento;
                    /*if (documento.Equals("13"))
                        oDocumentTypeParamas.DocumentSubType = "bod_DebitMemo";
                    //Get series collection
                    oSeriesCollection = oSeriersService.GetDocumentSeries(oDocumentTypeParamas);
                    oSeries = oSeriesCollection.Item(0);
                    elAnterior = oSeries.NextNumber;
                catch (Exception e)
                    MessageBox.Show("Se presento un error: " + e.Message);
                return elAnterior;
    And I try to use the DocumentSubType property of DocumentTypeParamas but it seems to be invalid,
    I'll appreciate if you can help me....
    Thanks.....

    Hi,
         Use describe statment.
    data: lv_line type i.
        Describe table itab lines lv_line.
        read table itab into wa_itab index lv_line.
    regards,
    Santosh Thorat

  • How to get the last record from the database

    I am using MS Access database and Swings as GUI. I want to get the last record of a particular column from the table and store it as a varaible.

    Hi
    To get Last record of resultset, you have pass some parameter in constructor of CreateStatement.In such case Resultset should be scrollable and Readonly
    Example
    objStatement=objCon.createStatement ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    mwwResultSet=cwwStatement.executeQuery(mwwSqlQuery);
    while(mwwResultSet.next())
    if(mwwResultSet.isLast())
    //Fetch the required column record.
    String abc=mwwResultSet.getString(1);
    I think this will work. Try it.
    bye

  • How to get the last time a record was modified or created ?

    Is there a way (hidden system fields for example, system view, other ?) to get the last time a record of a table was modified or the date it was created.
    Thanks for any help.
    Stiphane CAMPION

    blarman74 wrote:
    I know I could do this with a trigger, but I was wondering if there is a data dictionary view I can query to find the date/time a table was last updated. What I have is a table that is constantly getting hammered with new data being uploaded from a third party. We need to keep close tabs to verify that this datafeed is constantly running and bringing in new data. Because the data that comes in comes from multiple timezones and there are hundreds of lines, our attempts at monitoring by just looking at the data leave something to be desired.
    Any ideas?refer this links
    How to find Last modified/updated time of a particular table
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1590655700346557237
    Thanks

  • How to get the last different occurrence in a SCD table

    hey,
    i have a slowly changing dimension and i want to get the last different occurrence for each row.
    Sample Data
    the field LAST_VALUE is the one i'm looking for.
    ID     START_DATE     END_DATE     VALUE     LAST_VALUE
    1     01/01/2000     01/02/2000     X     null
    1     01/02/2000     01/03/2000     X     null
    1     01/03/2000     01/04/2000     Y     X
    1     01/04/2000     01/05/2000     Y     X
    1     01/05/2000     01/06/2000     X     Y
    1     01/06/2000     01/07/2000     X     Y
    1     01/07/2000     01/08/2000     Z     X
    1     01/08/2000     01/09/2000     Q     Z i want to try and do that without three sub selects.
    i've tried analytic functions but lag brings me the last occurrence which is not necessarily different.
    thanks.

    Something like this :
    SQL> with sample_data as (
      2    select 1 ID, to_date('01/01/2000','DD/MM/YYYY') START_DATE, to_date('01/02/2000','DD/MM/YYYY') END_DATE, 'X' VALUE from dual union all
      3    select 1, to_date('01/02/2000','DD/MM/YYYY'), to_date('01/03/2000','DD/MM/YYYY'), 'X' from dual union all
      4    select 1, to_date('01/03/2000','DD/MM/YYYY'), to_date('01/04/2000','DD/MM/YYYY'), 'Y' from dual union all
      5    select 1, to_date('01/04/2000','DD/MM/YYYY'), to_date('01/05/2000','DD/MM/YYYY'), 'Y' from dual union all
      6    select 1, to_date('01/05/2000','DD/MM/YYYY'), to_date('01/06/2000','DD/MM/YYYY'), 'X' from dual union all
      7    select 1, to_date('01/06/2000','DD/MM/YYYY'), to_date('01/07/2000','DD/MM/YYYY'), 'X' from dual union all
      8    select 1, to_date('01/07/2000','DD/MM/YYYY'), to_date('01/08/2000','DD/MM/YYYY'), 'Z' from dual union all
      9    select 1, to_date('01/08/2000','DD/MM/YYYY'), to_date('01/09/2000','DD/MM/YYYY'), 'Q' from dual
    10  )
    11  select v.id
    12       , v.start_date
    13       , v.end_date
    14       , v.value
    15       , last_value(case when value != prev_value then prev_value end ignore nulls)
    16               over(partition by id order by start_date) as "LAST_VALUE"
    17  from (
    18    select t.*
    19         , lag(value) over(partition by id order by start_date) as prev_value
    20    from sample_data t
    21  ) v
    22  ;
            ID START_DATE  END_DATE    VALUE LAST_VALUE
             1 01/01/2000  01/02/2000  X    
             1 01/02/2000  01/03/2000  X    
             1 01/03/2000  01/04/2000  Y     X
             1 01/04/2000  01/05/2000  Y     X
             1 01/05/2000  01/06/2000  X     Y
             1 01/06/2000  01/07/2000  X     Y
             1 01/07/2000  01/08/2000  Z     X
             1 01/08/2000  01/09/2000  Q     Z
    8 rows selected

  • How to get the last inserted record from a table ?

    :-) Hiee E'body
    I work on Oracle 8i and need to get the last
    record inserted in a table.
    I have tried using rownum and rowid pseudo-columns
    but that doesn't work.
    Can you please help me out ?
    :-) Have a nice time
    Vivek Kapoor.
    IT, Atul Ltd.,
    India.

    I'm not sure about 8i features.
    I assume here that you don't have 'Date-Time' stamp columns on the table which is the easiest way to determine the last inserted row in the table.
    If not try the following :-
    select address, piece, SQL_TEXT
    from V$SQLTEXT
    where upper(sql_text) like '%INSERT INTO TABLE_NAME%'
    Substiute the TABLE_NAME with the name of the actual table.
    Have fun.
    Regards,
    Shailender
    :-) Hiee E'body
    I work on Oracle 8i and need to get the last
    record inserted in a table.
    I have tried using rownum and rowid pseudo-columns
    but that doesn't work.
    Can you please help me out ?
    :-) Have a nice time
    Vivek Kapoor.
    IT, Atul Ltd.,
    India.

  • How to get the last day of calweek

    Hi Guys,
                Is there any function module to get the last day of the calendarweek.
    I want to show that last date of calweek in my column heading.

    You can use the Calender class...
    Calendar c = Calendar.getInstance();
    and then something like...
    c.add(c.MONTH, 1);
    int dayOfMonth = c.get(Calender.MONTH);
    c.add(c.DAY_OF_MONTH, - (dayOfMonth-1) );
    other usefull functions are:
    System.out.println(" YEAR : " + c.get(Calendar.YEAR));
    System.out.println(" MONTH : " + c.get(Calendar.MONTH));
    System.out.println(" DAY_OF_MONTH : " + c.get(Calendar.DAY_OF_MONTH));
    System.out.println(" DAY_OF_WEEK : " + c.get(Calendar.DAY_OF_WEEK));
    System.out.println(" DAY_OF_YEAR : " + c.get(Calendar.DAY_OF_YEAR));
    System.out.println(" WEEK_OF_YEAR : " + c.get(Calendar.WEEK_OF_YEAR));
    System.out.println(" WEEK_OF_MONTH : " + c.get(Calendar.WEEK_OF_MONTH));
    System.out.println(" DAY_OF_WEEK_IN_MONTH : " + c.get(Calendar.DAY_OF_WEEK_IN_MONTH));
    System.out.println(" HOUR : " + c.get(Calendar.HOUR));
    System.out.println(" AM_PM : " + c.get(Calendar.AM_PM));
    System.out.println(" HOUR_OF_DAY (24-hour): " + c.get(Calendar.HOUR_OF_DAY));
    System.out.println(" MINUTE : " + c.get(Calendar.MINUTE));
    System.out.println(" SECOND : " + c.get(Calendar.SECOND));
    System.out.println();*/

Maybe you are looking for

  • Basic Smart Objects

    1. In CS5, If I drag a layer from one file to another, does PS always place the image as a smart object into the new file? 2. I understand that the idea behind smart objects is that I can edit the smart object without making permanent changes, though

  • URGENT!!  Error Codes: AGEGTYVF

    Guys, please i want config my agent to send some reports via email in PDF for me but after i set the email address in analysis this error message appears for me. ] Eventually succeeded, but encountered and resolved errors... Number of skipped recipie

  • IPhone 5S and iPad 4 crashing

    Hi, 2 months ago I purchessed a new iPhone 5S 32GB, and I also have iPad 4 32GB. Recently I've been expiriating more and more crashes in both of my devices. Why this happens and how can I fix it? I had the iPad and iPhone 4 before the iPhone 5S and I

  • IDispatch error #19876 - LDAP Authentication Source - User Unique Name Attribute

    Hi, we have troubles with the User Unique Name Attribute: As 'cn' and 'dn' may change we want to use the EmployeeID ('workforceID') as unique identifier for our user synchronisation. This attribute exists and is also imported in the profile service.

  • Can't get email notifications to stop - please help!

    I'm posting this message per instructions for "How do I stop receiving email notifications from Adobe Forums?" at  http://forums.adobe.com/thread/416458?tstart=0 I have followed the instructions dated June 30, 2010, gone to "MyStuff  and followed all