Possible to capture the delimiter with split(String, regex)?

If StringTokenizer is frowned on, is it possilble to capture the delimiter in the string array when using split()?

In Perl, all you have to do is put parentheses around the regex to have the delimiters returned as tokens. I can understand why the Sun devs left that feature out, though: it would make split's behavior twice as confusing as it already is. Anyway, I can't think of a better way to do it than your lookaround method, Sabre.
If StringTokenizer is frowned on,
Says who?Says the docs, actually. They say to use split() instead, as if it were a drop-in replacement for StringTokenizer. Then they confuse people even more by implying that split("\\s") is equivalent to the default behavior of StringTokenizer (it should be split("\\s+")). I submitted a bug report about that, but they didn't want to hear it.

Similar Messages

  • Is it possible to remove the delimiting line between Bookmarks bar and Tab bar?

    I place the Tab bar between the Bookmarks bar and the page content area, as the attached image shows.
    Is it possible to remove the delimiting line between Bookmarks bar and Tab bar? I feel that line is redundant.

    Your Tab bar doesn't look standard.
    Did you check the code with the default theme if you currently use a custom theme?
    ''(note that you can still use the code with a smaller font size if you like the monospace font; I do prefer this to make it easier to click the mouse)''

  • Is it possible to use the value of a string to reference a component in the

    I'm fairly new to Java so this may be a stupid question!
    Is it possible to use the value of a string to reference a component in the code? For example in the code below, Wall is a class holding 3 different arrays. The Robot class has an array called finishBricks. When the buildWall method is run it receives the integers width and height which are used to construct the dimensions string. I want to use this string to then load the appropriate Wall array into the finishBricks array.
    I hope this makes sense! Any help would be greatly appreciated!
    class Robot {
    public double[][] finishBricks;
    public void buildWall(int width, int height) {
    Wall w = new Wall();
    String dimensions = "Wall" width "x" +height;
    this.finishBricks = w.xxxx; // where xxxx is replaced by whatever the String dimensions is
    class Wall {
         public double[][] Wall4x2 = {
              {-30.00,-01.60,27.45},
              {-30.00,-06.75,27.45},
              {-30.00,-13.55,27.45},
              {-30.00,-20.35,27.45},
              {-30.00,-22.00,28.65},
              {-30.00,-16.85,28.65},
              {-30.00,-10.05,28.65},
              {-30.00,-03.25,28.65}
         public double[][] Wall3x3 = {
              {-30.00,-01.60,27.45},
              {-30.00,-06.75,27.45},
              {-30.00,-13.55,27.45},
              {-30.00,-15.20,28.65},
              {-30.00,-10.05,28.65},
              {-30.00,-03.25,28.65},
              {-30.00,-01.60,29.85},
              {-30.00,-06.75,29.85},
              {-30.00,-13.55,29.85},
         public double[][] Wall2x4 = {
              {-30.00,-01.60,27.45},
              {-30.00,-06.75,27.45},
              {-30.00,-08.40,28.65},
              {-30.00,-03.25,28.65},
              {-30.00,-01.60,29.85},
              {-30.00,-06.75,29.85},
              {-30.00,-08.40,31.05},
              {-30.00,-03.25,31.05},

    Map walls = new HashMap ();
    walls.put ("2x2", new double[][] {
        new double[] {
            1,
            0
        new double[] {
            0,
            1
    double[][] wall = (double[][]) walls.get ("2x2");

  • When a warranty replacement in hand, is it possible to change the 4s with 5 by extra fees?

    when a warranty replacement in hand, is it possible to change the 4s with 5 by extra fees?

    Sadly, life is sometimes unfair. Although, I'm not certain why you feel you would be entitled to any form of upgrade. It is neither stated nor implied in any Apple literature.

  • I have a touchscreen laptop running Windows 8.1. Is it possible to use the touchscreen with Firefox? I've installed Firefox but it only works with the mouse etc

    have a touchscreen laptop running Windows 8.1. Is it possible to use the touchscreen with Firefox? I've installed Firefox but it only works with the mouse etc

    Hello Sirving575, sorry but the metro version of firefox has been cancelled, see : https://blog.mozilla.org/futurereleases/2014/03/14/metro/
    thank you

  • I would like to ask if is possible to predict a future version of iOS can have the possibility to choose the color with which to write and be able to choose the character also...

    I would like to ask if is possible to predict a future version of iOS can have the possibility to choose the color with which to write and be able to choose the character also...

    Nobody here would have a crystal ball and know what Apple plans on doing in the furture.
    If you feel this feature is so important, you can let Apple know:
    www.apple.com/feedback

  • Is it possible to sync the iphone with my company's email server

    Is it possible to sync the iphone with my company's email server (Novell Groupwise)? I have the option of getting a blackberry or iphone. I want the iphone, but I also want to be able to sync it with my work email since I am away from the office a lot. I know I need to contact the IT department, but I thought I would try here to see what experiences people had with this sistuation. Thanks.

    Depends on what protocols they will allow (or can). If they open up POP or better yet IMAP access, then yes, sure. It is all about the protocols available to you (them). Though note, the iPhone checks on an interval where the Blackberry has emails pushed to it. So with iPhone, the min interval time is 15mins.
    Message was edited by: DaVBMan

  • Is it possible to pair the playbook with the BlackBerry Visor Mount Speakerphone VM-605?

    Can i listen to my music from my playbook with my
    vehicle's stereo system by using the Blackberry
    Visor Mount Spwakerphone VM-605?
    Is it possible to pair the playbook with the
    BlackBerry Visor Mount Speakerphone VM-605?

    From what I've seen here and @ Crackberry yes once you've gotten the 2.0 upgrade.
    Information Technology is fun! Play with IT.

  • Is it possible to connect the java with XL database

    Hi friends,
    Is it possible to connect the java with XL database.
    if it is possible can u send the detail for that .
    Thnax in Advance..............

    What the heck is a XL database?

  • String.class without split(String regex)

    hello,
    This is my problem:
    I am using eclipse with j2sdk1.4.2 which
    implement
    the clase String.class with
    method replaceAll(String regex, String replacement) and
    method split(String regex)
    PAth: home_j2sdk1.4.2/jre/lib/rt.jar 25.762kb
    In this way:
    String columns[] = line.split("\t");
    for (int i=0; i<columns.length; i++)
    ws.addCell(new Label(i,row,columns.replaceAll("\"","")));
    I move the code above to websphere Application Developer 5.1.2
    which use Home_Websphere/eclipse/jre/lib/rt.jar 8.827 kb
    this jar in yours String.class not contains the
    method replaceAll(String regex, String replacement) and
    method split(String regex)
    I need to find the use my code above with that methods,
    what i need to do ???
    possible,i need to find the source to String.java of j2sdk1.4.2
    which implement the methods, but where ???
    or there is another way to do it ???
    Any help is greatly appreciated.

    If websphere is supposedly 1.4 compatible, arethey
    "allowed" to leave out methods from the JFC? Not sure what the JFC is, but no, they would not be
    allowed to leave out any methods.
    JFC - Java Foundation Classes. I think they started calling what might be considered the Java Core the JFC when they first added Swing to the distribution. Maybe the term is no longer used.
    RRD-R      
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Capture the filename with ODI

    Please find the query below. This has to be done exclusively in ODI only no shell scripts to get the file name.
    Input file name : abc_<timestamp>.txt.
    Now need to read the file and capture the filename.
    Read the file and move it to Archive or Error Directories based on the output
    How can we achieve this with in ODI?
    Please let me know your inputs as early as possible.
    Thanks in Advance.

    Yes, it's possible.
    For capturing filename you should use procedure using jython/beanshell
    if the file is a source then you can use interfaces
    Use the ---> for OK sucess and KO error
    Use ODIFileMove utility to move the file
    In order to do all these you should have understanding of using variables, models and interfaces.
    For my part i have done a procedure which can monitor a directory and capture filenames as soon as file arrives , then invoke scenarios passing the filenames through variables.

  • Is possible to capture the SP username of who is making submission of the data from an InfoPath 2010 form?

    Hi all,
    Does anyone know how to capture the SP username of who is making submission of the data from an InfoPath 2010 form? I looking to avoid the user need to type extra information like username/ manager name, etc; and then use code behind to be doing validation
    before to push that data to an sql server.
    Any suggestion , book reference , link is acceptable 
    thanks in advance
    CRISTINA& MICROSOFT Forum

    Hi Cristina,
    Please check the following article with using web service UserProfileService.asmx to get the current user profile in InfoPath code behind and use the validating event to do some complex validation, it should help.
    http://blogs.msdn.com/b/infopath/archive/2007/03/07/get-the-user-profile-through-moss-web-services.aspx
    http://codesupport.wordpress.com/2010/04/05/sharepoints-userprofileservices-getuserprofilebyname-method/
    http://www.bizsupportonline.net/infopath2007/infopath-basics-3-ways-validate-data-infopath.htm
    http://henry-chong.com/2010/12/infopath-validation-gotcha/
    Thanks
    Daniel Yang
    TechNet Community Support

  • Is it possible to run the vi with a button on the front panel?

    Hi to all,
    I was wondering if it is possible to run a vi with a button placed on the front panel.
    Regards,
    Palazzo

    Palazzo wrote:
    Run vi when opened is not useful in my application, I know that option, thanks.
    Can you elaborate? Programmed as a proper state machine, have the program run in an idle state that only waits for for a button press.
    There is no need ever to go to edit mode during execution of a finished program.
    while I have written a demo Xcontrol to show that everything is possible, I strongly recommend against it. It makes no sense.
    See here for the example and instructions. But please read the entire thread, though.
    LabVIEW Champion . Do more with less code and in less time .

  • HELP. Capture the Hdv with the Apple prores422 Capturing, but i can't chande the name of the file

    Hello there,
    i'm conforming an hdv shot while i capture it into FCP whit the setting of Apple pro res422.
    So the point is that when i start to capture the only thing that i can controle is to give the name of the file that i'm going to capture..
    everything is ok, but whet i have to chage the tape and so..the name of the file it does not work, even if i write the new name he keep the last name that i  use...
    i don't know what to do, i can't change the name after i capture because he capture the tape creating different file at all the stop of the shooting, so that i have alot of file for one tape..
    it looks like he keep in memory some protocols with the first name i give..but how i can change it when i change the tape??
    thnak u
    fede

    When you are logging your tape prior to capture you can do this.  For example, tape one contains scenes 1,2 and three, multiple takes of each.  Go to the beginning of scene one take 1.  Mark an in point.  Go to the end of all the takes of scene 1 and mark an out point.  Log the clip as scene one.  Do the same for scenes 2 and three.  Hit the batch capture button.
    Then as it captures it creates scene 1, scene1-1, scene 1-2, scene 1-3, et cetera.
    I HATE HDV.

  • Is it Possible to Map the Transformations with already mapped ones

    Hi,
    I have a scenario :
    In my source DSO I have a infoobject 0BILL_NUM,which is mapped with ZB1_PRC in the destination datatarget.Here a routine has written on the destination infoobject ZB1_PRC for the follwing fields in the source system ZBILL_ITM,0COMP_CODE,0BILL_NUM.
    In the destination system 0BILL_NUM is mapped with 0REFER_ITM .
    In the target system a routine has wriiten for 0BILL_NUM
    for the fields 0COMP_CODE,0REFER_DOC,0REFER_ITM and 0BILL_NUM
    What is the solution to push my data into the target system,after mapping.
    Now Is tht possible to map two infoobjects 0BILL_NUM from the source to the target system infoobject 0BILL_NUM.If not possible, what is the alternative solution
    Regards
    Lucky

    hi,
    while creating the transformation u can find the option as rule group ok,
    first you can map as per the first requirement then in the rule group option u have new rule group there u can assign the second mapping along with other infoobject mappings.
    chk out the options in transformation -> rule group
    Ramesh

Maybe you are looking for

  • Migrate EAR to weblogic 10.3

    I want to migrate an application from weblogic 8.1.6 to weblogic 10.3. I have the EAR(containing web services & ejb) file which is running in weblogic 8.1.6,but unfortunately no source is available.Please let me know if I can upgrade this EAR in webl

  • Startup abort and startup hard drive no longer recognized

    i went to install leopard and the disc verified itself and i picked my startup disk and archive and install and started the install then got the message that the install failed and contact the manufacturer. then my original startup disk is not recogn

  • A certain website doesn't work properly in Firefox anymore.

    I used to use a website www.padmapper.com After a recent update to Firefox (I think 3 or 4 updates ago) I suddenly couldn't use the website properly anymore. It would load but some of the options of for instance choosing a price-range wasn't working.

  • Do I need an audio interface if I have a mixer?

    Hi, I'm just starting to use Garageband on my iMac G5 (which I bought in Jan last year). I also have a pretty basic Kustom PA with a mixer which I am currently plugging directly into my computer. Should I be getting an external audio interface as wel

  • Fixed the first problem, now its mistaken my 512mb...

    can u HELP me. the subject really says all that needs to be said.