Need example of delimiter of Scanner method for breaking the values

Please give me an example of the delimiter method of Scanner class from which I can break up a value for example
if a user enters from scanner credit card number 12-56789-8990 "-" dash must occur in between. like this format xx-xxxxxx-xxxxx-xx.

Guess what, there's a discussion going on about the very same topic here.
You wouldn't happen to have two user accounts for flame-free cross posting, would you?
db

Similar Messages

  • Is there any native method for converting String value to Hungarian notat..

    Hello. there.
    This might be very simple question. but I'm just curious about this.
    I am wondering if Java API offer the any native method for converting uppercased string value to lowercase which obey the Hungarian notation.
    What I'm going to do is using Reflection for excuting RFC function on SAP. I was found it is very similar to JDBC Programming.
    Please refer to blow codes.
    //mTable
    JCoTable mTable = function.getTableParameterList().getTable(rtnTblNm);
        for (int i = 0; i < mTable.getNumRows(); i++) {
         mTable.setRow(i);
         HashMap tmpData = new HashMap ();
              for (int j=0; j < mTable.getNumColumns(); j++) {
                     // I want to set key String [userNo] instead of  [USER_NO] here.
              tmpData.put(mTable.getMetaData().getName(j).toLowerCase(), mTable.getString(j));
              result.add(tmpData);
    } Basically, The idea was from ibatis framework [com.ibatis.common.beans.classInfo] dropcase();
    Any idea would be very helpful for me. Thank you.
    Edited by: hosung.seo on Aug 30, 2009 10:42 PM
    Edited by: hosung.seo on Aug 30, 2009 10:50 PM

    ejp wrote:
    Hungarian notation is a representation of logical/arithmetic expressions in postfix form. Not what you're talking about.
    So your title is very confusing to the people here who know what it means, which is probably all of them, because people read threads based on their title.From now on, I will pay more attention when I post an question.
    If the titile as " +Is there any native method for converting String value to camelcase?"+ would be easier to what i'm pointing at.
    As I mentioned in above sorce code, converting [USER_NO] to [userNo] isn't relevant Hungarian notation. yes, it was ambiguous. Agree! :)
    But some answer wasn't fit to converting case or recognizing "underscore" delimiter. I was expecting toCamelCase() such as blew. Thanks.
        public static String toCamelCase(String name) {
            String lowerName = name.toLowerCase();
            String[] pieces = lowerName.split("_");
            if (pieces.length == 1) {
                return lowerName;
            StringBuffer result = new StringBuffer(pieces[0]);
            for (int i = 1; i < pieces.length; i++) {
                result.append(Character.toUpperCase(pieces.charAt(0)));
    result.append(pieces[i].substring(1));
    return result.toString();

  • How to avoid report running for all the values in roll up of guided naviga

    Hi
    Thanks in Advance
    I have 3 reports on three different pages of a dashboard. (Implemented guided navigation on one column of each report).When I click on value of guided navigation column it guides me to report 2 for that particular value (is prompted), same way for 3 report also till here it works fine.
    However when I return from report 3 to report 2 and 2 to 1, the reports are running for all the values instead for the value which was passed by guided navigation of previous report earlier (Value on which I clicked to pass to the next report).
    Edited by: 808623 on Nov 9, 2010 2:10 AM

    Yes
    Example : If i click on values 'X' in report 1
    Report 2 shows results for 'X' only. And if i click on Value say 'Y' in 2 then report 3 shows for only 'Y'. But when i rollup from 3 to 2, Report 2 is showing for all values rather than showing 'x'.
    I'm using Link or Image Dashboard Object > Destination>Request or Dashboard (path of previous report)
    Edited by: 808623 on Nov 9, 2010 2:37 AM

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • Please give  me example of delimiter in scanner

    Please anyone give me information,I need an example of Scanner method where I can validate an integer date with delimiter
    example -
    dd-mm-yyyy The dash "-" must come in between the dates while the user types the date like 27- 4 -

    I am trying to insert a particular date from scanner method but I am getting error as incompatible type found String expected Date, I tried parser but it didn't work, please check the code and let me can you correct it, I want to enter date through scanner date like 09-06-2008
    import java.text.SimpleDateFormat;
    import java.util.*;
    import java.io.*;
    import java.util.Date;
    public class Example
    // instance variables - replace the example below with your own
    Scanner scan=new Scanner(System.in);
    public void date()
    Date date = new Date();
    date = scan.next();
    String DATE_FORMAT = "MM/dd/yyyy";
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
    System.out.println("Today is " + sdf.format(date) );
    }

  • Need help/hints/tips with a method for connect 4 game.

    Hi!
    I'm currently trying to get my "movepiece"-method to make it so that players can only drag a piece into the empty square at the bottom row, and if the square is not empty the method will move up one row and check if it's empty if not, repeat until
     6 are checked if no one is empty then move is invalid.
    I've been trying out while loops and for loops but i think i might set the wrong conditions for exiting the loop...
    Here the code for the method without any loops simply adds pieces.
            /// <summary>
            /// Method that performs the actual move.
            /// The old piece gets overrun by the attacking piece. 
            /// The attacking piece's position becomes null.
            /// </summary>public Piece[,] MoveAttackpiece(int[,] changearray)
    int origX = changearray[0, 0];
    int origY = changearray[0, 1];
    int targetX = changearray[1, 0];
    int targetY = changearray[1, 1];
    pieceArray[targetX, targetY] = pieceArray[origX, origY]; //swap
    return pieceArray;
    The game is using winforms and a 2D array(pieceArray)to draw the game board
    I'm using a Constants class for declaring the height and width of the board, which the pieceArray is based on, Namely const int BOARDESIZEx and BOARDERSIZEy.
    And while i'm at it when i did different loops for tryng to make the piece move down/up (based on if a square in bottom row was empty or not) the program crashes and i get the "Null Reference Exception unhandled"
    at this part in the game.CS (the earlier code reside in a class named Squares.cs)
    if (changearray != null)
    //Building string to print (split over several rows for readability but also to avoid calculations)
    Piece attackpiece = pieceArray[changearray[1, 0], changearray[1, 1]];
    string message = "";
    if (move % 2 == 1) message += "TURN " + move / 2 + ":\r\n"; //integer division, as there are two draws per turn
    message += attackpiece.Name + ": "; //Walker:
    message += IntegerToChar(changearray[0, 1]); //Walker: A
    message += (changearray[0, 0] + 1) + " - "; //Walker A1 -
    message += IntegerToChar(changearray[1, 1]); //Walker A1 - B
    message += (changearray[1, 0] + 1); //Walker A1 - B2
    if (move % 2 == 0) message += "\r\n"; //blank row inserted after each completed turn
    Board.PrintMove(message);
    I've tried making
    While(piecearray[targetX, targetY]!=null)
    pieceArray[targetX, targetY]==pieceArray[targetX, targetY +1];
    return array;
    but that didn't work and i don't really know how to make the game start at bottom row.
    I appreciate any help or tips on how to get this to work since it's the only thing left for making the game work as intended.
    Cheers and thanks for reading.
    PS: if there's anything you wonder just ask and i'll explain as much as i can.
    Regards Gabbelino
    Student at the University of Borås, Sweden

    Let's look at what's wrong with the following code.
    While(piecearray[targetX, targetY]!=null)
    pieceArray[targetX, targetY]=pieceArray[targetX, targetY +1]; // I assume the "==" in your post above was a typo.
    Suppose, for the sake of argument, that targetX is 2 and targetY is 3, and that pieceArray[2,3] is not null. The line inside the loop will then become...
    pieceArray[2,3] = pieceArray[2, 4];
    ...and this line will keep being executed as long as pieceArray[2,3] is not null, which if pieceArray[2,4] is not null will be forever (infinite loop).
    I suspect that your loop should look something like this...
    for(int i = 0; i < BOARDSIZEy; i++)
    // Look for the first available square in the target column.
    // When found, set the piece on that square then break out.
    if(pieceArray[targetX, i] == null)
    pieceArray[targetX, i] = pieceArray[origX, origY];
    break;

  • Webdynpro abap-method for saving updated values in new database table

    Hi Experts,
    I am creating an ALV  application in weddynpro abap where i have given update button to update fields & save button to save values in mastertable,but whenever i am updating & saving ,it will overwrit previous values. For this,I need  to create a separate method to save the updated values of the fields in a new database table.
    Looking forward for solutions.
    Thank You!

    becuase of the below statement u r getting the error
    insert into ZTAB_CS_ISSSAL values Item_Dates.
    u declared the field Item_Dates as Stru_Issuesal-DATES
    and u were trying to inesrting the record in the table ZTAB_CS_ISSSAL with the field Item_Dates
    the error is related to the compatible.
    so declare work area for updating the table should be of type ZTAB_CS_ISSSAL.

  • Method for measuring low value of RPM using counters

    I need to measure frequency of low values,which is the best for obtaining a low value of RPM,the hardware used is NI-PXI 6602 card.

    There are examples written for measuring the frequency of TTL signals. If you are using LabVIEW, you can search the data acquisition examples and you will find a separate folder for counters (...Program Files\National Instruments\LabVIEW\examples). There will be a NI-TIO.llb which will contain all examples you can use with the NI 6602. There is a Measure Frequency VI that will work for you. For text-based programming environments, there will be examples installed within the ...\Program Files\National Instruments\NI-DAQ\Examples directory. I hope this helps.
    Regards,
    Todd D.
    Applications Engineer
    National Instruments

  • Do we need a ODI agent to be running for using the startscen command

    Do we need a ODI full installation(both server and client) for using the Startscen command or just the client install should be enough. And also do we need a ODI agent to be configured and running for using this StartScen command
    Thanks

    ODI client is an agent.
    So you don't need to declare one more if not needed on your infrastructure.
    But to run odistartscen you need to configure the odiparams.bat with your repository connexion.
    If not it will try to connect by default to the demo repostory on HSQL.
    best regards,
    Brice

  • Method for Saving the attendence data

    Dear All,
                 We are implementing the HR,MM,FI,SD module and also implementing  the Kronos Time Machine for Time details.
    I got the text file in which employee attendence data is mentioned  from the kronos system.Now which way i have to used for upload this information in sap tables or infotype .Because some buddy told we can not used the CATS ,I don't know why.
    So now how i can save attendence data and also in which table in sap we have to save that data.Kindly Help me .I am using IT2001,2002 and 2006 infotype for time management
    Kindly tell me the procedure for saving the Attendence data it' urg.
    Thanks
    sandeep
    Edited by: SANDEEEP DABRAL on Jun 19, 2009 2:45 PM

    Hi
    Does your client is using punch in and punch out data. If then then we can store the P10 and P20 data in SAP directly with the help of the integration with 3rd party systems.
    If not then just prepare a customized prghramme with the help of ABAP guys to uplad the data in IT 2002 against the absence types.
    For this you need to do the Absences customization in SAP R/3
    Thanks
    Sheetal

  • Standard method for storing gps values

    what is the standard method to store gps values in database tables.

    user10447332 wrote:
    for storing gps values oracle spatial is copmulsary? is there any alternative solutionYou hijacking the OP's thread?
    I assume you mean "compulsary". ;)
    No, nothing is compulsary, you could store GPS values in your own data structure if you choose. However Oracle spatial is usually the place where spatial data such as GPS values are processed.
    Depends what you want to do with it.

  • Function module for updating the values in table VTTK

    Hi,
    I am working on a report in which I need to update the value of field tdlnr of table vttk for a particular shipment number. I need to do this using functional module and I am not been able to find one. If anyone knows answer to this plz help.
    Thanks in advance,
    Priyanka.

    As noted above, RETURN table must be supplied empty, it is for BAPI to return the messages back to the calling program. You simply need to define an internal table, pass it to BAPI as is and then analyze this table after the BAPI call. For example:
    DATA: BEGIN OF it_return OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF it_return.
    CALL FUNCTION 'BAPI_SHIPMENT_CHANGE'
    <...>
      TABLES
    <...>
        return = it_return.
    LOOP AT it_return.
      MESSAGE
           ID      it_return-id
           TYPE    it_return-type
           NUMBER  it_return-number
       WITH
                   it_return-message_v1
                   it_return-message_v2
                   it_return-message_v3
                   it_return-message_v4.
    ENDLOOP.
    Hope this helps.

  • New solution for Limit the value in JSpinner with changable max/min value

    I have ever stuck with a problem like that :
    1. My application need to get two int value A and B that user input.
    I use two JSpinner with Number format model.
    named in jSpinnerFrom (A value get from) jSpinnerTo (B value get from)
    2. The request is that :
    two value can be any Integer, But the value of (B - A) can not more than 1000.
    I use changeListener added into the JSpinner, when use set value make (B-A) larger than 1000, I set value back.
    But when user press mouse on arrow button, the value will be increase automaticaly, and at last the value can not set back that make (B-A) not larger than 1000.
    3. So I get the BasicArrowButton of the jSpinnerFrom and jSPinnerTo,
    and add a mouselistener on the arrowbutton. When mouseReleased, then chen the value (B-A), if it is larger than 1000, then set it back the proper value.
    Thus I can make the min/max value in the JSpinner be changable, and limit the two input value be in range of 1 - 1000
    Post this wish be help for any one has thus familar request.
    Good Luck!!

    Something like this might work
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.event.*;
    class Spin extends JFrame implements ChangeListener
      JSpinner spinner1;
      JSpinner spinner2;
      JPanel jp;
      public Spin()
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(200,75);
        setLocation(400,300);
        spinner1 = new JSpinner(new SpinnerNumberModel(1000, 1000, 9999, 5));
        spinner1.addChangeListener(this);
        spinner2 = new JSpinner(new SpinnerNumberModel(0, 0, 1000, 5));
        jp = new JPanel();
        jp.add(spinner1);
        jp.add(spinner2);
        getContentPane().add(jp);
      public void stateChanged(ChangeEvent ce)
        int s1 = ((Integer)spinner1.getValue()).intValue();
        jp.remove(spinner2);
        spinner2 = new JSpinner(new SpinnerNumberModel(s1-1000, s1-1000, s1, 5));
        jp.add(spinner2);
        validate();
      public static void main(String[] args) {new Spin().setVisible(true);}
    }

  • Method to identify the value difference

    Dear Experts,
    We run a blocked invoices report (t-code ZMR0) from which the invoices are manually released. This report, among other details, is calculating and displaying the value difference for which the respective invoice got price blocked. As I know ZMR0 is calling MRBR in order to actually release the invoices.
    Is there a way of extracting this value difference after the respective invoice(s) was released?
    Thank you in advance for your help.

    Hi,
    Based on the your price control in the material master it will hit the price difference a/c if the price control is standard price
    And if the price control is moving average price it will load to the materail inventory account is suffient stock is available
    if partial stock is available it will partly load inventory and partly hit price difference account
    So probably you will have cretae the another table to update this diiference when you run your Z report it will be difficult to get these
    values from the system
    Thanks
    Diwakar

  • Formule used in the transaction MP30 for calcolate the value ROP.

    Dear gurus,
    in the transaction MP30 we insert the value in the field "Corrected value" and  the system calcolate a value of the parameter Reorder Point . What formule use for calcolated this value? How this value is calcolated.?
    Thansk a lot
    Daniele Pistilli
    PP TEAM

    Hi,
    Check the OSS Note 415950 - Calculation of the safety stock in the forecast.
    The caliculation is explained in details.
    And also the below link:
    [Calculating the Safety Stock and the Reorder Level|http://help.sap.com/saphelp_erp60_sp/helpdata/en/7d/c27408454011d182b40000e829fbfe/content.htm]
    [Reorder Level Calculation|http://help.sap.com/saphelp_erp60_sp/helpdata/en/7d/c27a3b454011d182b40000e829fbfe/content.htm]
    Hope this helps.
    Regards,
    Siva

Maybe you are looking for

  • Background processing of CM21

    Hello all I am trying to run the transaction CM21 in background processing through LSMW transaction, but it shows me the following error per each item: Run-time error "RAISE_EXCEPTION" occurred > Short dump "101201 202224 MEXQAS01 0_ECQ_01 " generate

  • Trouble printing to Canon ip4200 over Airport Express from Windows XP

    I've just spent the last 4 hours trying to get my Dell laptop running XP to print to my Canon ip4200 USB printer connected to my Airport Express. My PowerBook (10.3.4) connected without issue and has been working fine. The XP laptop just refused to p

  • Acrobat reader 7 I downloaded didn't compatible with my laptop Windows 8, pls help!!

    Dear friends, My name is Terry. Acrobat reader 7 I downloaded didn't compatible with my laptop Windows 8, pls help!! Thanx.

  • Howto when i have very very large double array

    I have code my program about document retrieval. I create double array in size [10000]x[8000] for keep value for calculte someting in only memory (about metrix operation). I have set parameter to heap memory size at 1024m but it not enough, it has ex

  • Indesign | serial number | help

    I have followed all the instructions and still cannot find a serial number at all? I have tried to access In design but it is still demanding a serial number which I do not have?