How to get string in reverse order?

Hi I have line as follows...
String line = "officer.Bangalore, ind",corp\user,passwordAdapter;I want to get the out put of string in reverse order....
passwordAdapter,corp\user, "officer.Bangalore, ind" please help on code to get this output....
I tried with using StringBuffer class but it reversing the content of string but not order of string..
thank in advance....
Jags

srry for that...
lets assume the above is line from file and storing in a string variable..
In that case.. how can i reverse the order of string(line)...
i know it should be like this..
String line = "\"officer.Bangalore, ind\",corp\user,passwordAdapter";plz do the needfull...
thanks,
jags

Similar Messages

  • [C] Trying to sort string into reverse order ... Blank. [SOLVED]

    Here are the pre-processors:
    #include <stdio.h>
    #include <string.h>
    Here are the global variables:
    char output[999];
    Here's the function to sort string to reverse order (I THINK THE PROBLEM IS HERE):
    char output[999];
    char *sort_reverse(const char *str)
    int i, j = 0;
    for (i = strlen(str); i > 0; i--)
    output[j] = str[i];
    j++;
    return output;
    And, function int main(void):
    int main(void)
    printf("Reverse of \"Hello\": %s\n", sort_reverse("Hello"));
    return 0;
    The output is:
    Reverse of "Hello":
    Why is that? how can i fix that?
    Last edited by milo64 (2013-03-28 01:45:46)

    Instead of the global char output[999] wich is really big, you could allocate a perfectly sized array with calloc - like this in the sort_reverse function:
    char *output = calloc(strlen(input_string), sizeof(char));
    and in main program:
    char *reversed_string = sort_reverse("Whatever");
    printf("%s\n", reversed_string);
    //Remember to free reversed_string with
    free(reversed_string);
    //Since its allocated in the heap with calloc()
    Try check man-page for calloc, it will zero out the bytes aswell, then you wont have to worry about setting the last element to '\0'.
    NOTE: you have to iterate with "strlen(input_string) - 1" otherwise you will overwrite the needed '\0'
    EDIT:  As strlen excludes the '\0' in original string, then you have to make space for that by adding one to strlen return value so:
    char *output = calloc(strlen(input_string) + 1, sizeof(char));
    Last edited by Boogie (2013-04-05 09:46:12)

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • How to get my images always order by file name, and not by time of captur, in all the folders in the library?

    How to get my images always order by arquive name, and not by time of captur, in all the folders in the library?
    Sorry for the poor english, but im portugues.
    In the library we can change the order of classification of image by, time of capture, name of file etc... I'm wondering if its possible define to be always by the name of file.
    It ´s possible?
    And i have other question, in print label we have an option to auto rotate to feet in page to have the image using the maximum area in the page (auto rotate, zoom etc), its possible to change the orientation of the rotation to be always in  the other direction?

    The Muvos are USB Mass Storage devices and do not have the ability to display track information based upon ID3 tags.
    The Zens all read and display track info based upon ID3 tag information that is either gathered from an online source or entered by the end-user.
    If you want the track information displayed instead of the ID3 tag information, you could edit the ID3 tags and rename the title to whatever you have as the file name. Not sure why your file names would differ so much from the ID3 tag info though, almost all of my content has the same name for the filename as it does on the ID3 tag title.

  • How to get the all process orders and outbound deliveries based on material

    Hi Team ,
    I need one help from you regarding the MB 56 transaction.
    My doubt is : How to get the all process orders and outbound deliveries based on material, plant and batch?
    Please help me regarding this.
    Thanks & Regards,
    Srikanth.

    Hi,
    You can use ST05,to trace the program and find out,
    hope it will help you...
    thanks and regards,
    veera.

  • How to get Sales Text & Purchase Order Text in MM based on (MSEG-MATNR)

    Hi
      Am working on a Report based on Purchase order & Sales, Could any body tell How to get Sales Text & Purchase Order Text in MM based on (MSEG-MATNR).
    the Field i need to get are : SALES TEXT, PO TEXT.
    Sunil.

    Hi Sunil,
    For getting Material PO text and sales text, you have to rely on Purchase Order and Sales Order. And use READ_TEXT function module to fetch the text.
    Below are examples of PO text and Sales Text:
    1. PO text:
        CALL FUNCTION 'READ_TEXT'
         EXPORT
           ID = 'F03'
           LANGUAGE = SY-LANGU
           NAME = '450000011200010' conacte PO number and line item number
           OBJECT = 'EKPO'
         TABLES
           LINES = INT_TLINES "you will get text in this table
    2. Sales order text:
            CALL FUNCTION 'READ_TEXT'
         EXPORT
           ID = '0001'
           LANGUAGE = SY-LANGU
           NAME = '0000000036000010' conacte SO number and line item number
           OBJECT = 'VBBP'
         TABLES
           LINES = INT_TLINES "you will get text in this table
    ref: STXH and STXL tables.
    Hope it will solve the problem.
    Regards
    Krishnendu

  • How to get string from jtextpane along with its attributes

    sir,
    How to get string from jtextpane along with its attributes
    i,e font,size,style,color etc.
    please help me out.
    my mail id is [email protected]

    JTextPane extends JTextComponent
    JTextComponent.getDocument()
    a Document is a set of Element, see Document.getRootElements(). Each Element has attributes, stored within an AttributSet object see Element.getAttributes()
    a Document can also be rendered as a String, see Document.getText( offest, length ), use it with 0 and Document.getLength() as parameters.

  • I have been charged 274.55 from 8-23-2013 - 8-26-2013. These are not my charges. I need to know how to get the charges reversed and put back on my account ASAP. Please confirm!

    I have been charged 274.55 from 8-23-2013 - 8-26-2013. These are not my charges. I need to know how to get the charges reversed and put back on my account ASAP. Please confirm!

    You can contact iTunes Support via this page (we are fellow users here on these forums) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • Getting WSDL in reverse order after server upgrade from WAS 5.1 to 6.1

    Hi All.I need your help.I am working in RAD 7.0 .After the IBM websphere upgrade from 5.1 to 6.1 i am getting the wsdl generated exactly in reverse order(in 6.1) as compared to that in version 5.1.Can you tell me wat can be the issue .We are using glue-pro jar for generating the WSDL.is there any setting in RAD or WAS which need to be changed so that i can get WSDL in old format.
    Any suggestion or opinion is welcomed.

    Does it matter? And if so, why does it matter?
    From my previous experience with Glue you don't want to have it generate WSDLs anyway. It's not very good at it at all, generates WSDL that are full of errors.
    Better to write your own WSDL and tell Glue to use those.

  • How to get the data in order by date

    Hi,
    i am getting the data like bellow i need the data with out null values
    date     col1     col2     col3     col4
    16-Nov-11     23               
    17-Nov-11     12               
    18-Nov-11     321               
    19-Nov-11     23               
    20-Nov-11     132               
    16-Nov-11          2321          
    17-Nov-11          112          
    18-Nov-11          211          
    19-Nov-11          132          
    20-Nov-11          12          
    16-Nov-11               45     
    17-Nov-11               465     
    18-Nov-11               2123     
    19-Nov-11               132     
    20-Nov-11               65     
    16-Nov-11                    456
    17-Nov-11                    546
    18-Nov-11                    4656
    19-Nov-11                    566
    20-Nov-11                    564
    need out like below
    date     col1     col2     col3     col4
    16-Nov-11     23     2321     45     456
    17-Nov-11     12     112     465     546
    18-Nov-11     321     211     2123     4656
    19-Nov-11     23     132     132     566
    20-Nov-11     132     12     65     564
    Thanks in advance,
    Venkat.

    Hi, Venkat,
    user6552629 wrote:
    Hi,
    i am getting the data like bellow i need the data with out null values
    date     col1     col2     col3     col4
    16-Nov-11     23               
    17-Nov-11     12               
    18-Nov-11     321               
    19-Nov-11     23               
    20-Nov-11     132               
    16-Nov-11          2321          
    17-Nov-11          112          
    ...You may have noticed that this site noramlly compresses whitespace. As a result, it looks like col1 is present on every row, but col2, col3 and col4 are always NULL.
    Whenever you post formatted text on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing, so that your message can look like this:date          col1     col2     col3     col4
    16-Nov-11     23               
    17-Nov-11     12               
    18-Nov-11     321               
    19-Nov-11     23               
    20-Nov-11     132               
    16-Nov-11          2321          
    17-Nov-11          112          
    You want to take a table, that has multiple rows for the same dt, and produce a result set that has one row per dt.  That sound like a job for GROUP BY:SELECT     dt     -- DATE is not a good column name
    ,     MIN (col1)     AS col1
    ,     MIN (col2)     AS col2
    ,     MIN (col3)     AS col3
    ,     MIN (col4)     AS col4
    FROM     table_x
    GROUP BY dt     -- See note below
    ORDER BY dt
    Depending on your data and your requirements, you may need to use TRUNC (dt) in all 3 places where I used dt above.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    You'll get better replies sooner if you post this information every time you have a question.
    Edited by: Frank Kulash on Nov 15, 2011 10:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get String form java JTable row?

    Hello everybody,
    Can anybody tell me how to get value as String form java JTable row?

    I found solution:
            table.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseClicked(MouseEvent evt) {
                    if (evt.getClickCount() == 2){
                        int col = table.getSelectedColumn();
                        int row = table.getSelectedRow();
                        String tableUrl = ((String)table.getModel().getValueAt(row, col));
                        ur.openUrl(tableUrl);
            });

  • How to get know the Sales Order IDOC#, if I know the created Sales Order#?

    Hi Experts,
    Let me know that, How to get know the IODC #, if I know the Sales Order#?
    Scenario is that, sales order(say 12345678) was created from Inbound EDI. I also Know the MATERIAL too.
    So, How to pull the associated Inbound ORDERS idoc, which is created this Sales order-12345678?
    Is it from EDID4 table? or EDIDC? or any thing else?
    reples r appreciated.
    thanq
    Edited by: SAP ABAPer on Sep 8, 2008 5:29 AM

    Hello
    This can be done much easier using fm SREL_GET_NEXT_NEIGHBORS:
    Input:
    OBJECT-OBJKEY = <number of sales order>  " with leading zeros!!!
    OBJECT-OBJTYPE = 'BUS2032'
    MAX_HOPS = '01'
    Result:
    NEIGHBORS-OBJKEY = <IDoc number with leading zeros>
    NEIGHBORS-OBJTYPE = 'IDOC'
    NEIGHBORS-ROLETYPE = 'INIDOC'.
    Regards
      Uwe

  • How to display text in reverse order ?

    I was wondering how to display data [text-numbers...etc] in the reversed order.
    E.g.
    if the data is as follows:
    ORACLE
    it should be displayed as:
    ELCARO
    thanx in advance !

    An alternative would be a MODEL clause solution:Nice!
    Here another alternative with only one measure:
    SQL> create table t
      2  as
      3  select 'bocajijA' col1 from dual union all
      4  select 'ORACLE' from dual union all
      5  select null from dual
      6  /
    Tabel is aangemaakt.
    SQL> select old_col
      2       , col1
      3    from t
      4   model
      5         partition by (col1 old_col)
      6         dimension by (0 i)
      7         measures (col1)
      8         rules iterate(10000) until (iteration_number = length(col1[0])-1)
      9         ( col1[0]
    10           = substr(col1[0],1,iteration_number) ||
    11             substr(col1[0],length(col1[0]),1) ||
    12             substr(col1[0],iteration_number + 1, length(col1[0])-iteration_number-1)
    13         )
    14  /
    OLD_COL  COL1
    bocajijA Ajijacob
    ORACLE   ELCARO
    3 rijen zijn geselecteerd.Regards,
    Rob.

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

Maybe you are looking for

  • Error in Java Embedding Activity

    Hi All, I am using JavaEmbedding Activity in hellojava.bpel using this code snippet:- try Element nameElem = (Element)getVariableData("inputVariable","payload","/client:helloJavaProcessRequest/client:input"); String name = nameElem.getTextContent();

  • Bugs I've identified

    These are some bugs I've identified with Safari which have yet to be resolved in the latest version available for download (as far as I can tell anyway!) ... - There is a memory leak somewhere in the application - a few times I've had to kill the pro

  • How Can I Include The Session MM_Username In A Link?

    Greetings: I would like to have a link on a page such as "Show My Personal Page" with the underlying link actually being in the form of "Username.php" where the Username part will change based on which user is logged in. In the properties link field

  • What happens if I purge the central cache in Bridge?

    I am getting a window that says Bridge has encountered a problem, unable to read the central cache and that I should try to purge the central cache. So what happens? I do photography and have lots of photo files with associated previews. What are the

  • Computer shutting down when trying to turn airport on

    anytime i click on the "turn airport on" button the screen dims and a gray box appears and says i need to restart my computer. what can i do so i can use airport without habing to restart the computer?