All combination of string

consider an array of items:
String l1[]={a,b,c,d,e,f},how can we generate all combination of this set,which contains output as follows:
c2[]={a a,a b,a c ,a d, a e,a f,aa,ab,ac,ad,ae,af,ba,bb,bc,bd,be,bf,...........}
can any one suggest logic of doing this in java

hi learner,
String a[] = {"a","b","c"};
String c[] = new String[a.length * a.length];
for(int i=0,k=0; i<3; i++)
for(int j=0;j<3;j++,k++)
c[k] = a[i]+a[j];
for(int i=0;i<c.length;i++)
System.out.println(c);
this is the solution you need.... right
regards
rajesh

Similar Messages

  • Academic advisement - Requirement Investigate All Combinations doesn't work

    hi guys,
    i have some trouble with Academic advisement (campus solutions 9.0 and bundle 14). i tried creating a requirement which contained a requirement with 7 line items. i set Choice Resolution Method of the requirement to Investigate All Combinations. please find the structure of the requirement group, requirement set up as follows.
    Requirement Group 1 => Requirement 1=>line 01 and line 02 and (line 03 or line 04 or line 05 or line 06) and line 07.
    i tried running an advisement report using a student who was supposed to be successful in the report, but turn out not. line 05 and line 07 had common courses. line 07 was supposed using the courses which line 05 didn't have to satisfy and leave the rest courses to line 05 to satisfy. but the result was that line 07 used the courses which line 05 had so that line 05 failed to satisfy. i don't know why it happened.
    i tried to find out the reason. the results as follows:
    remove line 01 and line 02: failed
    remove line 01, line 02 and line 03: failed
    remove line 03 and line 04: succeeded
    re-arrange the order of line items to line 01 and line 02 and (line 05 or line 03 or line 04 or line 06) and line 07: succeeded (but it's not the way we wanted)
    can anybody help? i attached some screen captures. thanks a lot.
    https://dl.dropboxusercontent.com/u/24621770/01.JPG
    https://dl.dropboxusercontent.com/u/24621770/02.JPG
    https://dl.dropboxusercontent.com/u/24621770/03.JPG
    https://dl.dropboxusercontent.com/u/24621770/04.JPG
    Chris

    hi ,
    the code looks something like this and no system variable is overwriting SY-SUBRC once set. 
    sy-subrc = 4.
      SELECT vbeln
             posnr
             vgbel
             vgpos
             FROM lips INTO TABLE lt_lips
             WHERE vbeln = komkbe1-vbeln.
    Read first delivery item to get PO reference
      READ TABLE lt_lips INTO ls_lips INDEX 1.
      IF sy-subrc = 0.
    Get Item category from PO item
        SELECT SINGLE pstyp
                      FROM ekpo
                      INTO lf_pstyp
                      WHERE ebeln = ls_lips-vgbel AND
                            ebelp = ls_lips-vgpos.
      ENDIF.
      IF lf_pstyp = '5'.
        sy-subrc = 4.
        EXIT.
      ELSE.
        CLEAR sy-subrc.
      ENDIF.

  • How can i combine a string array with a waveform array and write this to a file.

    I am trying to set my VI up so that I can enter test information (notes to myself) and combine that with the time and date then write this as well as the waveform data from the daq to a spreadsheet file.  I am sure this is a simple task but I am new to LabView so any help would be very appreciated.

    An XML file is not a spreadsheet-formatted file, so that's not likely to help...
    Simply call the Write To Spreadsheet File twice. The first time you wire in a 1D array of strings
    which is your test information. Then, you call it when you're writing out
    your data. Make sure you wire a True constant to the "append" input for
    that function.

  • Drill down problem when using union all combination

    Hi All,
    I have a simple report with a drill down. The report has three columns Region, Sales, Flag... which will drill down to detail level of sales. The Flag column has Y, N values and we added 'All' Value in flag so that the user can select Y, N and All from the table prompt in the report . We have used union all in the report using combination to add the ' All ' Value in the flag. The problem is that now the main report is not passing the Flag values to the detail report. Flag is prompted in the filter in detail report.
    If I remove the 'All' value from Analysis with only Y N selection criteria the drill down works.
    Is there any work around? I have to use table prompt and All value selection in flag for drill down.
    Thanks,
    Virat

    The problem is without union all when doing combination of analysis drill down works, when I use combination drill down does not work because it does not pass the parameters for flag . I have used union all to add All value in flag.

  • IMessage: Sender/Receiver 'Bubbles' Don't Alternate - All Blue in String

    My wife and I have an iPhone 4 and an iPad 2 (Wi-Fi only) between the two of us. Both devices have iOS 5.0 or better and both are using the same Apple ID and iTunes account. Here's the problem: When I iMessage the iPhone from the iPad (or vice versa), my message displays as a blue bubble, on the right side, ON THE iPHONE I just sent to. If she replies to that iMessage, it shows up as a blue bubble on the right side on the iPad. In other words, our iMessage conversations all appear one-sided. There are no grey bubbles. It's just a string of blue bubbles along the right side.
    However, to complicate this anomaly further, every once in a while one of our replies shows up as a grey 'reply' bubble. But then the very next reply ends up on the blue bubble side.
    The conversation displays identically on both devices. The irriating thing about this anamoly, is the incoming message alarm doesn't sound because the device sees it as coming from itself.
    Any ideas?

    Regarding the grey bubble, who knows.  You're using the iMessage app in a way it was not intended, so I can't comment on why it behaves like it does.
    As far as the algorithm is concerned, the two devices are "owned" by the same person.  Say you have the iPad and Wifey has the iPhone and the wife tries to send a text to the iPad.  Apple ID doesn't care.  All it sees is a user trying to send a text to himself.
    The reason you can use the same ID with two different devices is to keep the messages synced.  In my case, for example, I have an iPhone and an iPad.  When I respond to an iMessage message from another user, that response is synced to both devices.  It lets me pick up either device and keep the conversation going.
    As I said before, if you want to have the messages display properly between the two devices, you need different IDs on each device.

  • ArrayCollection all items in string

    I'm trying to find all vehicles that have a string of accessories.
    I have a comma sep string of optioncodes that represent selectedItems from an options List
    optionsString:String = leather,stripes, ...
    I have an ArrayCollection called vehicleOptions that contains a list of vehicle options one row per option
    VIN1,optioncode
    VIN1,optioncode
    VIN2,optioncode
    VIN2,optioncode
    VIN3,optioncode
    I need to retrieve all vehicles (VINs) that have, not one, but ALL of the optioncodes contained in the selected optioncodes string. 
    Any recommendations on how to do this?
    Once I have a list of VINs, this will allow me to filter down another List of vehicles on the lot by only the vehicles that have ALL the selected options.
    Thanks!
    Don

    Thanks Alex.
    indexOf should be fine for checking if one option exists.  I was just struggling with how to track/store only vehicles that  have ALL the items in the option string, not just one.
    I'm thinking a VIN array to store only the VINs that have all the options.  And basically removing the VIN if one of them is not found.  If all of the options are found, keep it.  Not sure if that will work.  I'm planned to try this today.
    Don

  • Mailboxes are all combined in iOS 7, how can I separate?

    I prefer being able to review the email in each account, one at a time.  iOS 7 has seen fit to combine them into one giant inbox. There must be a way to separate....anyone know how?
    Thanks in advance!

    Hi all...
    First create number of accounts in General --> Email (add as many accounts u want), Later when u opn emails... u wil find Inbox this is all the accounts list inbox. If u really want to seperate thm individually please scroll down & click individual accounts select inbox. (as shown)

  • CCX Editor - How to combine 2 String Variables

    [string] Variable1 = "/*"
    [string] Variable2 = "4340"
    I would like to combine these 2 Variables and set it to a 3rd Variable using the Set Step. So the final outcome would look like the following...
    [string] Variable3 = "/*4340"
    Here is what I have which is not working.
    Set Variable3 = Variable1 + Variable2

    Sorry guys. I actually had it correct. This is how I verified it.
    Open CCX Editor without loading a script.  Then, in the Debug menu choose Reactive Script. Choose your Script for the Script Name and then choose a timeout value. (I choose 15secs)
    Dial the number that triggers the script. Click on Debug and Insert a Breakpoint before the End Step. Now click on Debug and start Debugging. Once the script hits the Breakpoint, click on the Debug menu again and choose Evaluate. You can now select your Variable and evaluate its value.
    I noticed that I was using a  /  (forward slash)  instead of a \  (back slash) as the escape character. I was combining my two variables but using the wrong slash.  Oops.  Thanks for the help though.  I now see there are more than one way to accomplish this. 

  • Get a result for all step by string

    I'm have to get a result for all step by a string , when the step is pass/fail , it return a 0/1,when the step return a real value, it return a real value,in totally all step run over, the string will be have this format : "0,1,1,...1,0.44,0.55,0.43,0"
    how to created this kind of sequence procedure ?
    thank you in advance...
    Alex

    Hi,
    You could do this as of the report generation (reportgen_txt|html.seq).
    what are you going to do with this string that you propose to generate?
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Finding All Methods Containing String

    Hi All, I have a problem that I was hoping someone has already solved. Basically I need to generate a list of all the methods(and the classes they are in) that contain a given String. Has anyone got any ideas for me ?
    Thanks,
    Al.

    Do you mean that the code inside the method contains a particular sequence of characters? Or that the name of the method contains a particular sequence of characters? If you are developing on Windows, then Windows Explorer has search capability that includes "files containing ...", so you could at least identify the classes.

  • TDP: Sentiment analysis on combined word/string possible?

    Using TDP transform I am doing sentiment analysis of unstructured data. As this sentiment analysis depend on single word /sorce form which is mentioned in rule file.
    Is it possible to perform the sentiment analysis on combined word or string.
    E.g: "Good Morning"
    This is WeakPositive Sentiment as "Good" word is present. But I want to consider whole "Good Morning" word for sentiment analysis which I will probably define under NutralSentiment in rule file.

    Hi Allan,
    Check OSS Note 821382.
    Thanks
    Lakshman

  • Not all the connect strings are shown from tnsnames.ora

    Hi Guys,
    I am having a very strange problem. While trying to create a new connection in SQL Developer (I am using Version 1.1.2.25), and choosing " TNS " as connection type, I am just able to see 15-20 database entries, where my tnsnsames.ora contains more than 100 entries. And these 15-20 connect strings seem to have been picked randomly. So its like I am seeing the 1st entry, 4-8th entry, 20-24th entry from the tnsnames.ora.
    Any idea what needs to be done?
    Thanksm

    Hi there,
    I found what was wrong and would like to update it for the benefit of others. The tnsnames.ora was read upto all the entries which was in correct format. All the entries after the first incorrect entry was being ignored.
    E.g. if you tnsnames.ora is having 100 entries and entry number 50 is in wrong format, then SQLDEVELOPER will only show entries upto 49. Entry 50th onwards will not be shown.
    Hope this helps.
    Ashish

  • Regex backreference combined with string - how to separate

    Hi, 
    I'm doing a replace with a backreference but the backreference is being interpreted as part of the string instead. If I insert a space it is interpreted correctly but I do not want to have a space.
    Here's the code:
    $regex = '(<add key="Global.LoadBalancer.ServerFarmIPAddresses.CSV"\svalue=")(?:[^"]+)("\s/>)'
    $fillerString = '$1127.0.0.1$2'
    The expected result should be to change this string:
    <add key="Global.LoadBalancer.ServerFarmIPAddresses.CSV" value="10.10.10.10,10.10.10.9,10.128.128.211,10.128.128.111" /> 
    And change it to this one:
    <add key="Global.LoadBalancer.ServerFarmIPAddresses.CSV" value="127.0.0.1" /> 
    But instead it changes it to this:
        $1127.0.0.1" />    
    How can I separate the $1 from the Ip address without adding a space?

    Put curly braces around the "1" and "2" in the replacement string:
    $fillerString = '${1}127.0.0.1${2}'

  • Replace all in a string

    Hello,
    I need to replace all occurences of
    <image>url to a image goes here</image>
    to
    <img src="url to a image goes here"/>
    where "url to a image goes here" is a url to an image
    Could you let me know how the call to replaceAll method will look like?
    Thank you.

           line = line.replaceAll("<image>([^<]*)</image>", "<img src=\"$1\"/>");

  • List serial port fail in and I have exhausted all combination

    Background: If admintool can set serial I could have set it with a click.
    The error is "list serial port fail in "
    url:geocities.com/worldlinking/index.htm
    SO please help and guide.
    sunlearner.

    I have exactly the same problem:
    ASUS A7V133 Motherboard, Athlon 1.33Ghz
    Solaris 8 Release 10/01.
    ALL Recommended and Security patches installed.
    Device Config Assistant lists the ports as standard 16550 UARTS, which is correct - ASUS mention nothing 'special' about them.
    prtconf shows both ports with asy not attached.
    devfsadm does not change that. ports command has no effect.
    No /dev/tty/ttya or /dev/tty/ttyb or /dev/term/a etc.
    admintool says 'list serial port failed'
    ttymon has service entries for ttya and ttyb :
    #pmadm -l -s ttya
    zsmon ttymon ttya u root /dev/term/a I - /usr/bin/login - 9600 ldterm,ttcompat ttya login: - tvi925 y
    Any help greatly appreciated,
    --john                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • How to send a delayed notification email?

    How to send a delayed notification email? I have a requirement to send an email to the service requestor 2 days after the main fulfillment task is completed.  I know I can create a task that auto-completes using the Dummy adapter, but is there a way

  • "member of " not working with nested table of dates

    Can someone explain why this doesn't work. The last select does not return any row. When trying the same with a table of number, it works fine. drop table test; drop type date_tab; create type date_tab as table of date; create table test(dates date_t

  • Is there a bapi for this??

    Hi all, Please tell me if there is a bapi for loading the data from a txt file (Contolling/expenses data for months/fiscal yr periods) to the sap system. The t-code for manual entry is KP06. What Bapi would post in the same way? Thanks, Charles.

  • Is my iphone 5 unlocked? Pic inside

    Is this iphone unlocked? I bought it in Mexico http://i43.tinypic.com/ao6mp4.jpg Thank you.

  • Help asap - LR tiff export 3X larger than Photoshop tiff export

    I need to send 15 tiff files through an FTP site for an upcoming exhibit, and having exported files to the required specs find that they are huge, compared to exports straight from Photoshot set to exactly the same parameters - almost 3X larger to be