Create String from all Collection Items

Hi all, I've been using Project Siena for the last week and I'm having a lot of fun with it.
Right now, I'm having a problem creating a string comprised of all the rows of a particular collection.
I am trying to generate the string for an email body. So far I have a 1 column collection called EmailCollection. It consists of rows of text with the appropriate URL Encoded characters. I would like to be able to export all the rows of this
collection to a string, and then add this string into the Launch(mailto:) body variable.
Let me know if I'm not being clear with this, and thanks for any help in advance!
Elliot

Thanks for the reply, StonyArc. I actually used your original thread to get me started until I ran into problems with exporting the entire single column collection to a concatenated string. I found a way to get it working, though it's not an elegant solution
and it wont work if the number of rows in the collection changes.
I'll try to explain it here, and if anyone else can think of a better way, I'd like to try it :)
I needed to create an URL encoded string for my emails which consisted of the relevant pricing information from a Collection with 8 rows called NewPricingCollection. 
Collect(EmailPricing, Substitute(Substitute(Substitute(Concatenate(NewPricingCollection!SetupItem,": ", NewPricingCollection!NewAmount, " ", NewPricingCollection!UnitType, "s ($", NewPricingCollection!TotalPrice, ")"), " ", "%20"), "$", "%24"), ":", "%3A"));
This created a single column collection with 8 rows which looked like this: SetupItem: 5 Units ($TotalPrice). I used the substitute function to replace the non-URL friendly characters with their encoded equivalents. I'm not sure if this is the best
practice use of the Substitute function by the way.
Once I had the Single Column Collection, I couldn't find a way to concatenate the contents of each row into a single string. I was able to use the Lookup function to retrieve the first row of the collection, but that was it. Note that I may be using the
lookup function incorrectly too :)
I ended up using Last and LastN Functions to retrieve the specified number of rows from the end of the collection. Then I used the Lookup function to retrieve the string from the first row of each retrieved collection, then concatenated it together as a
single string - along with the rest of the email body.
LookUp(EmailPricing, Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,7), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,6), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,5), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,4), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,3), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,2), Result in EmailPricing, Result) & "%0A" & LookUp(LastN(EmailPricing,1), Result in EmailPricing, Result)
This created a string that looked like this inside of an email body:
SetupItem1: 5 Units ($TotalPrice)
SetupItem2: 5 Units ($TotalPrice)
SetupItem3: 5 Units ($TotalPrice)
SetupItem4: 5 Units ($TotalPrice)
SetupItem5: 5 Units ($TotalPrice)
SetupItem6: 5 Units ($TotalPrice)
SetupItem7: 5 Units ($TotalPrice)
SetupItem8: 5 Units ($TotalPrice)
As you can see it will only work correctly with a collection of 8 rows, so if the number of items changes, then I'll need to find a better solution. 

Similar Messages

  • Automatically create POs from all approved requisitions

    I want to be able to automatically create purchase orders from all approved iProc requisitions (but wont have contract or blanket POs to use)
    I can get the suggested buyer added into the iProc shopping cart but want to know best route. Most people seem to have to hack the work flows so that the POs get created.
    I thought about using standard interface table to create the POs but believe that link to the requisitions wont be made (problem with reporting and encumberances)
    Would be interested in recommendations as to the best way to do this
    Thanks

    Do you buy the same items from those 9000 suppliers over and over?
    Do you want to automatically create PO or you want it to be submitted for approval as well?
    You may want to consider setting up the automatic sourcing. This way, the ASL and sourcing rules are automatically created when you create the first blanket.
    http://www.oracleug.com/user-guide/purchasing-overview/overview-automatic-sourcing
    Sandeep Gandhi

  • ICal keeps sending email notifications from all agenda items from the last 2 years. After laptop start up this action is repeated every hour. How can I stop these 300 emails coming in every hour?

    iCal keeps sending email notifications of all agenda items from the last 2 years (then I bought my laptop). After laptop start up this action is repeated every hour. How can I stop these >300 emails coming in every hour?

    Hi,
    We have rolled out a fix for this issue.
    Please log off and log back in to your machine and the issue should be resolved automatically. In case that does not work, please manually run the msi installer posted here (may require reboot).
    For details, please refer to the KB article here: Multiple RunOnce keys created 11.0.10 and 10.1.13 Acrobat | Reader
    Please let us know if you still face any issues.
    Thanks,
    Ashu Mittal

  • Programmatically create array from common cluster items inside array of clusters

    I have seen many questions and responses on dealing with arrays of clusters, but none that discuss quite what I am looking for. I am trying to programmatically create an array from common cluster items inside array of clusters. I have a working solution but looking for a cleaner approach.  I have an array of clusters representing channels of data.  Each cluster contains a mixture of control data types, i.e.. names, types, range, values, units, etc. The entire cluster is a typedef made up of other typedefs such as the type, range and units and native controls like numeric and boolean. One array is a “block” or module. One cluster is a channel of data. I wrote a small vi to extract all the data with the same units and “pipe” them into another array so that I can process all the data from all the channels of the same units together.  It consists of a loop to iterate through the array, in which there is an unbundle by name and a case structure with a case for each unit.  Within a specific case, there is a build array for that unit and all the other non-relevant shift registers pass through.  As you can see from the attached snapshots, the effort to add an additional unit grows as each non-relevant case must be wired through.  It is important to note that there is no default case.  My question:  Is there a cleaner, more efficient and elegant way to do this?
    Thanks in advance!
    Solved!
    Go to Solution.
    Attachments:
    NI_Chan units to array_1.png ‏35 KB
    NI_Chan units to array_2.png ‏50 KB

    nathand wrote:
    Your comments made me curious, so I put together a quick test. Maybe there's an error in the code (below as a snippet, and attached as a VI) or maybe it's been fixed in LabVIEW 2013, but I'm consistently getting faster times from the IPE (2-3 ms versus 5-6ms for unbundle/index). See if you get the same results. For fun I flipped the order of the test and got the same results (this is why the snippet and the VI execute the tests in opposite order).
    This seems like a poster child for using the IPES!  We can look at the index array + replace subset and recognize that it is in place, but the compiler is not so clever (yet!).  The bundle/unbundle is a well-known "magic pattern" so it should be roughly equivalent to the IPES, with a tiny penalty due to overhead.
    Replace only the array operation with an IPES and leave the bundle/unbundle alone and I wager the times will be roughly the same as using the nested IPES.  Maybe even a slight lean toward the magic pattern now if I recall correctly.
    If you instantly recognize all combinations which the compiler will optimize and not optimize, or you want to exhaustively benchmark all of your code then pick and choose between the two to avoid the slight overhead.  Otherwise I think the IPES looks better, at best works MUCH better, and at worst works ever-so-slightly worse.  And as a not-so-gentle reminder to all:  if you really care about performance at this level of detail: TURN OFF DEBUGGING!

  • Selecting string from all the tables in databse

    Hi All,
    I need a help in finding the data from all the database tables at one time using single query.
    For e.g. I wanna search a string 'ABC' in all the database tables for a schema.
    I want to find out,which all tables (in either of its columns) contain this string strored inside themselves.
    For brand name changing,I need to find out all the tables and in turn all the columns containing that string where databse consisting of 1000 tables.
    Could anyone suggest me some option for this?Is it possible to avoid this tedious task to search individual table?

    Why is it necessary to search every column? Does your data model permit the brand name to be stored in any column?
    Whatever.
    I suggest starting with dba_tab_columns (where owner = 'WHATEVER') and look for those tables/columns that could possibly hold the brand name. You can eliminate NUMBER and DATE columns and VARCHAR columns that are too short.
    Spool that out to another script where each select statement is like this:
    SELECT 'TABLE_NAME.COLUMN_NAME', column_name
    FROM table_name
    WHERE UPPER(COLUMN_NAME) LIKE '%BRAND NAME%'
    AND rownum = 1;

  • Not able to create DIR from PR line Item

    Dear Friends,
    I have Cretaed Doc Type "CON" and entered "EBAN - Purchase Req. Item" in the object link and in Create Document I have mentioned " 1 - Create simple document".
    When I try to create a DIR from PR Line Item, there is no option or a logo in the Popup  where I can click and create DIR from The Object PR Line Item.
      I get the create Document icon in WBS element for same document type.
    Can anybody guide me the if I have missed any config.
    With Warm Regards
    Mangesh Pande
    Edited by: MANGESH PANDE on May 23, 2011 11:33 AM

    Screen calling is controlled by MM module -
    check
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=68747578
    I dont think its possible to create document from PR

  • How create TO from TR when items are QM relevant?

    I am using function module L_TO_CREATE_TR  to create a TO from a TR for raw materials being GR'd into a raw material warehouse. 
    QM is set up.  If I use function module L_TO_CREATE_TR,  I keep getting error 2 (QM_relevant).  However, if I go through LT04, I would need to go through palletization to  bring up the screen in order to choose the place into stock option before entering the bin into which I am placing stock
    Is there a way of creating a TO from TR where items are QM relevant with some function without resorting to doing a call transation of LT04?
    Any help would be appreciated
    Regards
    Larissa Maryniuk
    Edited by: Larissa Maryniuk on Jan 19, 2010 5:11 PM

    Not been able to do this.  Going down LT04 route

  • Automatically create playlists from all albums

    Is there a way to do this so that I can use list view and play one album at a time? I've looked on the list and searched on the web.
    I know you can make album play lists easily, but only one at a time, by hand. I mean to simply get all them in one move.
    I know that the grid view gives you the equivalent, but the grid view consumes so much memory that it turns the computer into an expensive CD player. The cost of looking at all those little pictures runs to about 200 megs of memory for me, and that creates a difficulty for me. (Strange as it seems, I work on this machine, too.)
    In list view, iTunes does a great job, keeping memory use within 50 megs -- no problems there.
    When I moved my music from one file server to another, I lost my playlists. I had the xml file that other programs can use, but not apparently not iTunes to re-create playlists. Now I face the trouble of rebuilding them hand. It would be trivial to rewrite that xml file to change all the file paths, but I did not see a way importing the entire collection of playlists.
    It would seem to me that internally the iTunes database maintains an album by album list of songs (to show you in the grid view). One more step would loop through these and create playlists that show up in list view, eh?
    My favorite music player is Linux-only -- Rhythmbox -- which just gives automatically artist and album playlists, and keeps within 60 megs of memory. I tried the new Mozilla offering, Songbird, which is only in beta and has its own rough spots, but it, too, automatically gives you artist and album playlists. I don't know about the Windows players.
    tia,
    Barry

    Why don't you use the Browser, you can filter your list view right down to a single album using it. Go to View>Show Browser to make it visible. Alternatively press the Command (⌘) and B keys together.

  • Create xml from a collection type

    can anyone please explain me how to create an xml from a neseted table

    Hi Mario,
    Thanks for letting us know about this problem. I have logged a bug on this.
    If you should find any more problems like this, please let us know.
    Thanks,
    David

  • Function for search string in all table of a particular schema ? (postgres)

    Hi ,
    i want to create a function postgresql, that can able to search a string from all tables.
    I try as below.... please rectify this
    CREATE OR REPLACE FUNCTION search_string(str char(50))
    returnS character varying AS
    $BODY$
    DECLARE
         tempCount bigint ;
    record_v record;
    itemid_v bigint ;
    query varchar;
    return_v character varying := null;
    BEGIN
    for record_v in (select table_name ,column_name
                        from information_schema.columns and data_type in ('character','character varying','text')) loop
    query := 'select count(*) from '|| record_v.table_name ||' where ' || record_v.column_name || ' like ''%' || str ||'%''' ;
         execute query into tempcount;
              if (tempCount >0) then
              return      'l';
              else
              return      '2572';
              end if;
              end loop;
    END;
    $BODY$ LANGUAGE plpgsql VOLATILE
    COST 100;
    in output i need all tables in which string exists :
    like table_name      count_of_string_match

    Mr. singh wrote:
    oracle is the master of all databases - i hope u know
    if any body work on oracle .. he can right any query in any database :)Query maybe. but you were asking about functions. ANSI SQL is a pretty good standard for most normal dbs nowadays. But the procedural extensions differ more. Therefor you should go to a postgress forum to ask there. Or upgrade your database to oracle.

  • Can I batch create symbols from layers?

    I have Illustrator files of some fairly complicated schematics that I will be bringing in to Flash. The layers are already well organized and named so I would like to select particular layers, hit a "create symbols" button and have all of the selected layers turned into separate symbols that have the same name as their layer name. I would even be willing to code something to do this but I can't find any information about how it can be done.
    I know that I can import an Illustrator file into Flash and select layers that I can then make into movie clips but again, I have to manually select the layer, tell it to be a movie clip and then give it an instance name. I would be happy to try to automate that process as well but haven't found any info on how it can be done either.
    Does anyone have any ideas on how I can batch create symbols from my existing layers?

    I figured this out using recursion. Pasted here in case it helps someone else:
    #target Illustrator
    var docRef = app.activeDocument;
    var layersRef = app.activeDocument.layers;
    var layersCount = layersRef.length;
    var mySymbolInstance = null;
    if ( app.documents.length > 0 ) {
        // if the file is not empty, loop through all levels
        recurseLayers(docRef.layers);
        clearEmptyLayers();
        alert("I'm done");
    function recurseLayers(objArray) {
        // loop through main layers
        for (var l = 0; l < objArray.length; l++) {
            // loop through secondary layers
            if (objArray[l].layers.length > 0) {
                recurseLayers(objArray[l].layers);
            // loop through first level groups
            if (objArray[l].groupItems.length > 0) {
                recurseGroups(objArray[l].groupItems);
                // create a group
                var layerGrp = objArray[l].groupItems.add();
                //give new group the same name as the old group
                var layerName = objArray[l].name;
                layerGrp.name = layerName;
                // get all page items from group
                var layerGrpPageItems =  objArray[l].pageItems;
                //alert("how many group page items: " + layerGrpPageItems.length);
                for (var li= layerGrpPageItems.length-1; li >0; li--) {
                    // will become the symbol name
                    var layerPageItemName = layerGrpPageItems[li].name;
                    // if it's not already a symbol, make it into one
                    if (layerGrpPageItems[li].typename == "SymbolItem") {
                        layerGrpPageItems[li].moveToBeginning(layerGrp);
                    } else {
                        // create symbols
                        createSymbol(layerGrpPageItems[li], layerGrpPageItems[li].name);
                        // add symbols to group
                        mySymbolInstance.moveToBeginning(layerGrp);
                        // remove original content
                        layerGrpPageItems[li].remove();
                // create symbols from layer
                createSymbol(layerGrp, layerName);
                // remove original layer content
                layerGrp.remove();
    function recurseGroups(objArray) {
        for (var g = 0; g < objArray.length; g++) {
            // loop through second level groups
            if (objArray[g].groupItems.length > 0) {
                recurseGroups(objArray[g].groupItems);
                // create a group
                var grp = objArray[g].groupItems.add();
               //give new group the same name as the old group
                var groupName = objArray[g].name;
                grp.name = groupName;
                //alert("which group is this? " + groupName);
                // get all page items from group
                var grpPageItems =  objArray[g].pageItems;
                //alert("how many group page items: " + grpPageItems.length);
                for (var gi= grpPageItems.length-1; gi >0; gi--) {
                    // will become the symbol name
                    var pageItemName = groupName + "_" + grpPageItems[gi].name;
                    createSymbol(grpPageItems[gi], pageItemName);
                    // add symbols to group
                    mySymbolInstance.moveToBeginning(grp);
                    // remove original content
                    grpPageItems[gi].remove();
    function createSymbol(element, elementName) {
        //alert("elementName" + elementName);
        // create symbols from all items in the group
        var symbolRef = docRef.symbols.add(element);
        //alert("element unnamed before: " + elementName);
        // if the element name is empty, give it a name
        var addElementIndex = 0;
        if(elementName == "") {
            elementName = "unnamed" + addElementIndex;
            addElementIndex++;
        // loop through all the symbols in the document
        var symbolCount = docRef.symbols.length;
            for(var s=0; s<symbolCount; s++)  {
                // existing symbols
                var symbolCheck = docRef.symbols[s];
                //alert(symbolCheck.name);
                var addIndex = 0;
                // if the name already exists, add the index number to it and increment
                if(elementName == symbolCheck.name) {
                    elementName = elementName + addIndex;
                    addIndex++;
        symbolRef.name = elementName;
        //alert("symbol name: " + symbolRef.name);
        mySymbolInstance = docRef.symbolItems.add(symbolRef);
        mySymbolInstance.left = element.left;
        mySymbolInstance.top = element.top;
    function clearEmptyLayers() {
        if (documents.length > 0 && activeDocument.pathItems.length >= 0){
            for (var ni = layersCount - 1; ni >= 0; ni-- ) {
                // get sub layers
                var topLayer = docRef.layers[ni];
                for(var ii = topLayer.layers.length - 1; ii >=0; ii--) {
                    // delete empty sub layers
                    if ( topLayer.layers[ni].pageItems.length == 0 ) {
                        topLayer.layers[ni].remove();

  • Creating String frm new String(charBuffer.array()) Vs charBuffer.toString()

    Whats the difference in creating String from CharBuffer by using array and by using toString() ?
    When ever i have some UTF-8 chars in my file (""someFile"), String created from new String( charBuffer.array()) appends some extra null/junk charaters at the very end of the file.
    How ever when i try charBuffer.toString() its working fine.
    For simple ASCII i.e ISO-*** charset both methods are working fine.
    Please see below code for reproducing. Here "someFile" is any text file with some UTF-8 characters.
    public char[] getCharArray()
    throws IOException
    Charset charset = Charset.forName("UTF-8");
    CharsetDecoder decoder = charset.newDecoder();
    FileInputStream fis = new FileInputStream("someFile");
    FileChannel channel = fis.getChannel();
    int size = (int) channel.size();
    MappedByteBuffer mbb = channel.map(FileChannel.MapMode.READ_ONLY, 0 , size);
    CharBuffer cb = decoder.decode(mbb);
    channel.close();
    fis.close();
    return cb.array();
    public String getAsString()
    throws IOException
    Charset charset = Charset.forName("UTF-8");
    CharsetDecoder decoder = charset.newDecoder();
    FileInputStream fis = new FileInputStream("someFile");
    FileChannel channel = fis.getChannel();
    int size = (int) channel.size();
    MappedByteBuffer mbb = channel.map(FileChannel.MapMode.READ_ONLY, 0 , size);
    CharBuffer cb = decoder.decode(mbb);
    channel.close();
    fis.close();
    return cb.toString();
    String fromToString = getAsString();
    String fromCharArray = new String(getCharArray());

    Whats the difference in creating String from CharBuffer by using array and by using toString() ?array() returns the entire backing array regardless of offset and position. toString() takes those into account.
    When ever i have some UTF-8 chars in my file (""someFile"), String created from new String( charBuffer.array()) appends some extra null/junk charaters at the very end of the file.More probably you haven't filled the array.
    How ever when i try charBuffer.toString() its working fine.So there you go.

  • Need a Query to search a value from all tables.

    Hi,
    I would like to know, is there any way that we could search a string from all the tables.
    For example I need to find a STRING 'hello world', on which table it presents. I want to search it from all the tables, as there might be a situtation
    where we dont knwo which table the value gets stored.
    REgards
    Suresh

    Run this code ---this is only search for required value in VARCHAR2 column.as per ur requirement u can change it to oher dataype..
    Reply if its helpful to you
    DECLARE
    S SYS_REFCURSOR;
    CURSOR c_user_col IS
    SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE FROM USER_TAB_COLUMNS,TAB
    WHERE TABLE_NAME=TNAME AND TABTYPE='TABLE'
    ORDER BY TABLE_NAME;
    TYPE TAB_LIST
    IS
    RECORD
    TABLE_NAME VARCHAR2(1000),
    COLUMN_NAME VARCHAR2(1000),
    DATA_TYPE VARCHAR2(100));
    TYPE T_TAB_LIST
    IS
    TABLE OF TAB_LIST;
    L_TAB_LIST T_TAB_LIST := T_TAB_LIST();
    L_STMT CLOB;
    l_exists NUMBER;
    BEGIN
    FOR i IN c_user_col LOOP
    L_TAB_LIST.EXTEND;
    L_TAB_LIST(L_TAB_LIST.LAST).TABLE_NAME := I.TABLE_NAME;
    L_TAB_LIST(L_TAB_LIST.LAST).COLUMN_NAME := i.COLUMN_NAME;
    L_TAB_LIST(L_TAB_LIST.LAST).DATA_TYPE := i.DATA_TYPE;
    END LOOP;
    FOR i in 1..L_TAB_LIST.COUNT LOOP
    l_exists := NULL;
    IF L_TAB_LIST(I).DATA_TYPE = 'VARCHAR2' THEN
    L_STMT := 'SELECT 1 FROM '||L_TAB_LIST(I).TABLE_NAME||' WHERE '||L_TAB_LIST(I).COLUMN_NAME||'=''samplesdfsdfsdf''';
    OPEN S FOR L_STMT;
    FETCH S INTO l_exists;
    CLOSE S;
    IF l_exists IS NULL THEN
    NULL;
    ELSE
    DBMS_OUTPUT.PUT_LINE('Table name: '||L_TAB_LIST(I).TABLE_NAME||'--Column Name: '||L_TAB_LIST(I).COLUMN_NAME);
    DBMS_OUTPUT.PUT_LINE(L_STMT);
    END IF;
    END IF;
    END LOOP;
    END;

  • How to display all value of metadata from nodes collection model in content presenter template

    Hi All,
    first of all the new look of OTN is great.
    coming to problem i am facing (i dont know whr to ask here or in portal forum).
    i am creating a content presenter template to display list of items.
    now as per requirement i need to create a drop down to filter the list.
    now while check- in a file author would choose a value in one metadata field lets say xCategory(which is a single select list).
    i have to display similar category list on portal to allow user to filter list.
    i could hv used view of xCategory but problem is files are targeted to role using ACL. so u see i cant display all category to all users.
    also customer wants this whole thing to be Dynamic i.e. they can add value of xCategory later that to could be only for specific role (on portal it should be role specific , author can see whole list not a problem there).
    so what i think is if content is given as search result so the category. so now if i can get the all xCategory metedata from 'nodes' collection model in template i can create drop down with out having any additional bean.
    somthing like this
    #{nodes.xCategory} (but this one is not correct).
    please suggest me any solution.
    thanks
    -somesh

    Hi,
    you can do all of what you said with JSF. ADF Faces provides drag and drop functionality (have a look at the Web Developer Guide) that allow you to move nodes within a tree. The drag and drop framework sends an event notification to the server with a reference to the changed node.You can also have context menus on a tree node to help users creating, deleting and editing a tree nodes. JavaScript isn't required at all, even if you wanted to drag and drop a row in a table on top of a tree node to create a new tree node.
    I just finished a book project in which we explained this usecase. As soon as I find the time, I'll follow up with a blog entry on this as it seems to be a common requirement. However, as mentioned, the web developer guide on OTN explains drag and drop in ADF Faces pretty well.
    However, if you choose the "Search" link above, choose JDeveloper and ADF as the product to search for and type drag and drop as the search string, then you get lots of code sample posted in the past to this forum
    Frank

  • How to improve the speed of creating multiple strings from a char[]?

    Hi,
    I have a char[] and I want to create multiple Strings from the contents of this char[] at various offsets and of various lengths, without having to reallocate memory (my char[] is several tens of megabytes large). And the following function (from java/lang/String.java) would be perfect apart from the fact that it was designed so that only package-private classes may benefit from the speed improvements it offers:
        // Package private constructor which shares value array for speed.
        String(int offset, int count, char value[]) {
         this.value = value;
         this.offset = offset;
         this.count = count;
        }My first thought was to override the String class. But java.lang.String is final, so no good there. Plus it was a really bad idea to start with.
    My second thought was to make a java.lang.FastString which would then be package private, and could access the string's constructor, create a new string and then return it (thought I was real clever here) but no, apparently you cannot create a class within the package java.lang. Some sort of security issue.
    I am just wondering first if there is an easy way of forcing the compiler to obey me, or forcing it to allow me to access a package private constructer from outside the package. Either that, or some sort of security overrider, somehow.

    My laptop can create and garbage collect 10,000,000 Strings per second from char[] "hello world". That creates about 200 MB of strings per second (char = 2B). Test program below.
    A char[] "tens of megabytes large" shouldn't take too large a fraction of a second to convert to a bunch of Strings. Except, say, if the computer is memory-starved and swapping to disk. What kind of times do you get? Is it at all possible that there is something else slowing things down?
    using (literally) millions of charAt()'s would be
    suicide (code-wise) for me and my program."java -server" gives me 600,000,000 charAt()'s per second (actually more, but I put in some addition to prevent Hotspot from optimizing everything away). Test program below. A million calls would be 1.7 milliseconds. Using char[n] instead of charAt(n) is faster by a factor of less than 2. Are you sure millions of charAt()'s is a huge problem?
    public class t1
        public static void main(String args[])
         char hello[] = "hello world".toCharArray();
         for (int n = 0; n < 10; n++) {
             long start = System.currentTimeMillis();
             for (int m = 0; m < 1000 * 1000; m++) {
              String s1 = new String(hello);
              String s2 = new String(hello);
              String s3 = new String(hello);
              String s4 = new String(hello);
              String s5 = new String(hello);
             long end = System.currentTimeMillis();
             System.out.println("time " + (end - start) + " ms");
    public class t2
        static int global;
        public static void main(String args[])
         String hello = "hello world";
         for (int n = 0; n < 10; n++) {
             long start = System.currentTimeMillis();
             for (int m = 0; m < 10 * 1000 * 1000; m++) {
              global +=
                  hello.charAt(0) + hello.charAt(1) + hello.charAt(2) +
                  hello.charAt(3) + hello.charAt(4) + hello.charAt(5) +
                  hello.charAt(6) + hello.charAt(7) + hello.charAt(8) +
                  hello.charAt(9);
              global +=
                  hello.charAt(0) + hello.charAt(1) + hello.charAt(2) +
                  hello.charAt(3) + hello.charAt(4) + hello.charAt(5) +
                  hello.charAt(6) + hello.charAt(7) + hello.charAt(8) +
                  hello.charAt(9);
             long end = System.currentTimeMillis();
             System.out.println("time " + (end - start) + " ms");
    }

Maybe you are looking for

  • File not able to pick while using FCC at sender channel

    Hi Experts , we design one scenario that we need to process flat file to ECC. So we have used FCC at sender channel. while we testing ,  only its showing as successfull logs in channel , but we not able to pick the file. could you please check the be

  • Does FOR i IN 1..10 Uses Cursor?

    Hi, Yesterday i was conducting an interview and was asking questions related to cursor. I asked the candidate to explain about Implicit cursor. He gave me an example like this. for i in 1..10 loop end loop; At a first look it felt he was wrong. Becau

  • Updating License Key!

    Hi, I need help knowing how to update a license key for BeBuzz. I recently got a new blackberry bold 9780, because my old one had water damage. It is the exact same phone, and I am using my old SIM card. I installed BeBuzz on my new phone, and typed

  • ALE distribution error - 0 communication IDOC

    Hello, We are getting 0 communication IDOC generated for message type DOCMAS error for ALE document distribution error. Please advice where to look for the error. Anirudh

  • ATP category assignment in APO

    Hi Experts, how is it decided in APO which ATP category will be assigned to which material doc. why is it that ATP cat "CC" is for stock. If I want to use CS instead what are changes do I need to perform in R/3 and in APO.