How to separate one Argument to characters

I can�t find a solution to distinguish the characters in one parameter (args[0])
i.e. : the user has entered this line 1,2,3 which all are in one argument (args[0]). how can I separate these three numbers and add them to an array. and finally add them together.
I will appriciate if anybody answer my question
Thanks.
public class QMark
// private static int a =Integer.parseInt(args[0]);
// private static String Ar[] = new String[3];
public static void main(String[] args)
QMark qmark = new QMark();
int n =0;
for (int b=0; b<5/*args[0].length()*/ ; b=+2)
// Ar[n] = String.valueOf(b);
args[0].toCharArray();
n = n + 1;
}

public static void main(String [] s) {
   String [] arg0 = s[0].split(",");
   int sum = 0;
   for (int j = 0; j < arg0.length; j++)
        try { sum += Integer.parseInt(arg0[j]); }
        catch (NumberFormatException nfe)
             { System.out.println("Not a number"); }
   System.out.println(sum);
}

Similar Messages

  • How to separate one ITunes account into 2.

    When I bought my son an iPod touch last year I just set it up using my existing Apple ID. Now I would like to separate them so I only see my things and he only sees his. How do I do that?

    You will have to create a new Apple ID for your son, assuming that he is at least 13 years old. You can't split one Apple ID into 2.

  • How to separate multiple addressees on one to: or Bcc: line

    Can't figure out how to separate addressees on one line. Nowhere is this spelled out. Other forums say a colon or a semi-colon. Neither one works. When I add either one, the first address turns red, meaning it is no longer recognized by Thunderbird. Am using TB 24.6.0. Thanks in advance.

    ''gallicbear2 [[#question-1038045|said]]''
    <blockquote>
    Can't figure out how to separate addressees on one line. Nowhere is this spelled out. Other forums say a colon or a semi-colon. Neither one works. When I add either one, the first address turns red, meaning it is no longer recognized by Thunderbird. Am using TB 24.6.0. Thanks in advance.
    </blockquote>
    Thanks, Matt. That answers my question.

  • In outlook 13, How can I get my new mail to populate my existing "account" or "Profile" instead of two separate ones-reposted, maybe first was wrong place

    I set up outlook, using mainly wizards. I have received some mail from my provider account.
    trying to get data from my old pc, I accidently set up another account, it became default.
    I finally got it deleted
    I now have my first profile with email I received, and all data (contacts, emails and archived items) but now I can not get new email.
    I tried to "change settings" but there is no account listed to chose to change.
    I create new and again I have two accounts.
    How can I get my new mail to populate my existing "account" or "Profile" instead of two separate ones or
    How to set up completely new, and move everything from existing profile to it and get rid of existing, Just do not want two.
    Thank you so much.

    They can help you over here.
    http://answers.microsoft.com/en-us/office/forum/office_2013_release-outlook?sort=lastreplydate&dir=desc&tab=Threads&status=&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&tm=1387249501544
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • In outlook 13, How can I get my new mail to populate my existing "account" or "Profile" instead of two separate ones

    I set up outlook, using mainly wizards. I have received some mail from my provider account.
    trying to get data from my old pc, I accidently set up another account, it became default.
    I finally got it deleted
    I now have my first profile with email I received, and all data (contacts, emails and archived items) but now I can not get new email.
    I tried to "change settings" but there is no account listed to chose to change.
    I create new and again I have two accounts.
    How can I get my new mail to populate my existing "account" or "Profile" instead of two separate ones or
    How to set up completely new, and move everything from existing profile to it and get rid of existing, Just do not want two.
    Thank you so much.

    You can open your second profile which is no ability of receiving new mail and export all of messages/contacts/calendar item to a PST file and save it somewhere.
    Then open the first profile, import the privious PST file into this profile to solve the problem.
    Using .pst files in Microsoft Outlook is good way to transfer the data, here is some information how to manage the PST file for your reference.
    http://support.microsoft.com/kb/287070/en-us
    Tony Chen
    TechNet Community Support

  • How to separate report layout sections in one report

    All,
    I'm trying to determine how to separate report layout sections in one report using Report Builder 10g. My requirement is to provide a user the ability to display a report in PDF, excel, RTF formats. How can I assign LayoutA to 'PDF' and 'RTF', LayoutB to 'Spreadsheet'?
    I've attempted to utilize the Header and Main sections in the paper layout, which contain unique layouts of the same report, but during generation, both sections are being displayed.
    Thanks
    Edited by: Jdavis on Apr 10, 2009 10:56 PM

    Hi there,
    How are you running the report? If you are selecting different types of output before calling the report then you could pass a parameter that is checked at runtime in the report and suppresses the layouts you do not want using format triggers.
    Mark

  • How can I separate one column into multiple column?

    How can I separate one column into multiple column?
    This is what I have:
    BUYER_ID ATTRIBUTE_NAME ATTRIBUTE_VALUE
    0001 PHONE_NUMBER 555-555-0001
    0001 EMAIL [email protected]
    0001 CURRENCY USD
    0002 PHONE_NUMBER 555-555-0002
    0002 EMAIL [email protected]
    0002 CURRENCY USD
    0003 PHONE_NUMBER 555-555-0003
    0003 EMAIL [email protected]
    0003 CURRENCY CAD
    This is what I would like to have:
    BUYER_ID PHONE_NUMBER EMAIL CURRENCY
    0001 555-555-0001 [email protected] USD
    0002 555-555-0002 [email protected] USD
    0003 555-555-0003 [email protected] CAD
    Any help would be greatly appreciated.

    This is another solution. Suppose your actual table's name is test(which has the redundant data). create a table like this:
    CREATE TABLE test2 (BUYER_ID number(10),PHONE_NUMBER varchar2(50),EMAIL varchar2(50),CURRENCY varchar2(50));
    then you will type this procedure:
    declare
    phone_number_v varchar2(50);
    EMAIL_v varchar2(50);
    CURRENCY_v varchar2(50);
    cursor my_test is select * from test;
    begin
    for my_test_curs in my_test loop
    select ATTRIBUTE_VALUE INTO phone_number_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='PHONE_NUMBER';
    select ATTRIBUTE_VALUE INTO EMAIL_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='EMAIL';
    select ATTRIBUTE_VALUE INTO CURRENCY_v from test
    where person_id=my_test_curs.person_id
    and attribute_name ='CURRENCY';
    INSERT INTO test2
    VALUES (my_test_curs.person_id,phone_number_v,EMAIL_v,CURRENCY_v);
    END LOOP;
    END;
    Then you will create your final table like this:
    create table final_table as select * from test2 where 1=2;
    After that write this code:
    INSERT ALL
    into final_table
    SELECT DISTINCT(BUYER_ID),PHONE_NUMBER,EMAIL,CURRENCY
    FROM TEST2;
    If you have a huge amount of data in your original table this solution may take a long time to do what you need.

  • HT5621 My husband and I both have iPhone 5. We currently share the same apple I'd. How do we get separate ones. Him keeping his and me getting a new one? What is the best way to go about doing this?

    My husband and I both have iPhone 5. We currently share the same apple I'd. How do we get separate ones. Him keeping his and me getting a new one? What is the best way to go about doing this?

    FAQ apple id http://support.apple.com/kb/HT5622?viewlocale=en_US

  • How to enlarge the text or characters on web pages permanently

    I need to know how to enlarge the text or characters permanently. I have difficulty reading the characters of each new page. Every time I zoom in to enlarge characters, the new page automatically returns to small characters. Please help.
    Cheng Lin
    [email protected]

    Try one of these extensions:
    *Default FullZoom Level: https://addons.mozilla.org/en-US/firefox/addon/6965
    *NoSquint: https://addons.mozilla.org/en-US/firefox/addon/2592/
    **More NoSquint info: http://urandom.ca/nosquint/
    <br />
    '''Other issues needing your attention'''
    The information submitted with your question indicates that you have out of date plugins with known security and stability issues that should be updated. To see the plugins submitted with your question, click "More system details..." to the right of your original question post.
    *Adobe PDF Plug-In For Firefox and Netscape
    **New Adobe Reader X (version 10) with Protected Mode just released 2010-11-19
    **See: http://www.securityweek.com/adobe-releases-acrobat-reader-x-protected-mode
    *Shockwave Flash 10.0 r42
    *Next Generation Java Plug-in 1.6.0_22 for Mozilla browsers
    **No security issues corrected in version 1.6.0_23, but, according to Oracle/Java, some stability issues resolved.
    #'''Check your plugin versions''': http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Adobe Reader (PDF plugin):'''
    #*From within your existing Adobe Reader ('''<u>if you have it already installed</u>'''):
    #**Open the Adobe Reader program from your Programs list
    #**Click Help > Check for Updates
    #**Follow the prompts for updating
    #**If this method works for you, skip the "Download complete installer" section below and proceed to "After the installation" below
    #*Download complete installer ('''if you do <u>NOT</u> have Adobe Reader installed'''):
    #**Use the links below to avoid getting the troublesome "getplus" Adobe Download Manager and other "extras" you may not want
    #**Use Firefox to download and SAVE the installer to your hard drive from the appropriate link below
    #**Click "Save to File"; save to your Desktop (so you can find it)
    #**After download completes, close Firefox
    #**Click the installer you just downloaded and allow the install to continue
    #***Note: Vista and Win7 users may need to right-click the installer and choose "Run as Administrator"
    #**'''<u>Download link</u>''': ftp://ftp.adobe.com/pub/adobe/reader/
    #***Choose your OS
    #***Choose the latest #.x version (example 9.x, for version 9)
    #***Choose the highest number version listed
    #****NOTE: 10.x is the new Adobe Reader X (Windows and Mac only as of this posting)
    #***Choose your language
    #***Download the file
    #***Windows: choose the .exe file; Mac: choose the .dmg file
    #*Using either of the links below will force you to install the "getPlus" Adobe Download Manager. Also be sure to uncheck the McAfee Scanner if you do not want the link forcibly installed on your desktop
    #**''<u>Also see Download link</u>''': http://get.adobe.com/reader/otherversions/
    #**Also see: https://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox (do not use the link on this page for downloading; you may get the troublesome "getplus" Adobe Download Manager (Adobe DLM) and other "extras")
    #*After the installation, start Firefox and check your version again.
    #'''Update the [[Managing the Flash plugin|Flash]] plugin''' to the latest version.
    #*Download and SAVE to your Desktop so you can find the installer later
    #*If you do not have the current version, click on the "Player Download Center" link on the "'''Download and information'''" or "'''Download Manual installers'''" below
    #*After download is complete, exit Firefox
    #*Click on the installer you just downloaded and install
    #**Windows 7 and Vista: may need to right-click the installer and choose "Run as Administrator"
    #*Start Firefox and check your version again or test the installation by going back to the download link below
    #*'''Download and information''': http://www.adobe.com/software/flash/about/
    #**Use Firefox to go to the above site to update the Firefox plugin (will also install plugin for most other browsers; except IE)
    #**Use IE to go to the above site to update the IE ActiveX
    #*'''Download Manual installers'''. Note separate links for:
    #**Plugin for Firefox and most other browsers
    #**ActiveX for IE
    #'''Update the [[Java]] plugin''' to the latest version.
    #*Download site: http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)
    #*Also see "Manual Update" in this article: http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates
    #* Removing old versions (if needed): http://www.java.com/en/download/faq/remove_olderversions.xml
    #* Remove multiple Java Console extensions (if needed): http://kb.mozillazine.org
    #*Java Test: http://www.java.com/en/download/help/testvm.xml

  • How to convert string to 16 characters.

    My external unique id is too long, more then 30 characters.
    How to convert it to 30 characters using sql?

    You should find another extranal system id in order to mantain uniqueness, but you could also use the name field (that supports 50 characters), but it deppends of which entity you are using.
    Which is the entity? and...if the only way to insert data is by web services the you could use more than one field to verify uniqueness since you can query more than one field at the time.
    Hope it helps
    Kim.

  • How to display more than 132 characters in a smartform

    Hi Experts,
    I am reading notes/text entries by calling read_text and then passing them in a variable. I want to display the notes. But even after declaring the variable as  LINE2048, it is displaying only 255characters as output length in smartform.
    My code:
    TYPES: BEGIN OF TYP_FINAL,
             PARTNER_NO      TYPE BU_PARTNER,         "Partner No.
            OBJECT_ID       TYPE CRMT_OBJECT_ID_DB,  "Object ID
            PROCESS_TYPE    TYPE CRMT_PROCESS_TYPE,  "Activity Type
           ACTUAL_NOTE     TYPE LINE2048,           "Actual Notes
           END OF TYP_FINAL.
    data : T_FINAL           TYPE STANDARD TABLE OF TYP_FINAL,
              WA_FINAL          TYPE TYP_FINAL.
    data:  v_actualnote     TYPE LINE2048.
              CALL FUNCTION 'READ_TEXT'
                EXPORTING
                 CLIENT                        = SY-MANDT
                  ID                            = C_0002
                  LANGUAGE                      = sy-langu
                  NAME                          = l_name1
                  OBJECT                        = C_BUT000
                TABLES
                  LINES                         = t_line
               EXCEPTIONS
                 ID                            = 1
                 LANGUAGE                      = 2
              IF SY-SUBRC = 0.
               clear: v_accountnote.
               LOOP AT T_LINE INTO WA_LINE.
                 CONCATENATE v_accountnote wa_line INTO v_accountnote SEPARATED BY space.
                 clear: wa_line.
               ENDLOOP.
              wa_final-account_note = v_accountnote.
              clear: v_accountnote.
             ENDIF.
    On the smartformm side, under main window->loop->text(to display the variables).
    How to display more than 255 characters in a smartform.
    Regards,
    Sangeeta.

    why the heck would you use read_text when you want to print a text/note on a form?
    in SAP-Script we use the "INCLUDE"-Statement for this.
    and in smartforms a Text-node of type 'I'.
    you can not write all in one line and expect the system to handle this like a floating text.
    one character takes a cretain amount of space (varying for different characters and font and font sizes).
    you Page has a certain width, so where is the miracle in the thesis that on a sheet of paper with a certain width just a certain amount of characters will fit?

  • How to separate BPM 11g from ADF

    Hi all,
    we are facing with a huge issue about how to separate BPM 11g ADF Task page components from SOA/BPM to a new non-soa ADF managed server.
    We are ready to move on pre-production server from development enironment and the new environment has two different servers, one for Soa/Bpm and the second for a non-soa ADF server.
    We have deployed all and it seems work fine but...when we call:
            SecurityContext securityContext =  ADFContext.getCurrent().getSecurityContext();
            String username = securityContext.getUserName();
    got: username  = anonymous.
    Tried with this also:
                 String userName = "";            
                //read name from security context
                ADFContext adfCtx = ADFContext.getCurrent();
                SecurityContext secCntx = adfCtx.getSecurityContext();
                userName = secCntx.getUserName();      
                //read name from bpmWorklistContext context
                FacesContext context = FacesContext.getCurrentInstance();
                String ctx = (String)context.getApplication().evaluateExpressionGet(context, "#{pageFlowScope.bpmWorklistContext}", String.class);
                IWorkflowServiceClient workflowSvcClient = ADFWorklistBeanUtil.getWorkflowServiceClient();
                ITaskQueryService wfQueryService = workflowSvcClient.getTaskQueryService();
                IWorkflowContext wfContext;           
                try {
                    wfContext = wfQueryService.getWorkflowContext(ctx);
                    userName = wfContext.getUser();
                    logger.info("UserName from Oracle:" + userName);
                } catch (WorkflowException e) {
                    logger.info(e.getMessage());
                    e.printStackTrace();
                return userName;
    And received this error:
    "Oracle | Invalid Token Error in Verification Service.
    Invalid Token Error in Verification Service. Received invalid token in .
    Verify that correct token is passed."
    I have followed this blogs but no luck:
    Onkar's SOA, BPM and ADF Blog: How to separate BPM 11g ADF Task page components from SOA/BPM to a new ADF managed server
    http://blog.dreamix.eu/oracle-2/ultimate-guide-separating-bpm-adf
    Notes about Oracle: How to configure local integrated WebLogic non-SOA domain to access BPM worklist on separate SOA-ena…
    I do not understand where the error is. Why the SecurityContext is getting lost.
    Can you help me? Any suggestions will be welcome.
    Thanks.
    Fairlie

    Ok, these are the lines of code you can use to create a method that returns the authenticated user name:
    try {
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    } catch (Exception e) {
    e.printStackTrace();
    And you can add it to the backing bean of your page (a Java Class that you can declare to handle ADF Page components). Let me know if this helps.
    Jorge

  • Cannot convert character sets for one or more characters

    Hello,
    Issue:
    Source File:   Test.csv
    Source file dropped on application server as csv file via FTP
    Total records in csv file 102396
    I can able to load only 38,000 records after that I am getting error message  " convert character sets for one or more characters"  while loading into PSA .
    If i load same csv file from local workstation I am not getting any error message I can able to load total 102396 records.
    I am guessing while FTP the file into Application server some invalid codes adding?
    But I am FTP 7 files,  out of 7 I am unable to load only 1 file.
    Anybody have faced this kind of problem please share with me I will assign full points
    Thanks

    I checked lower case option for all IO
    When i checked the PSA failed log no of records processed is "0 of 0" my question is with out processing single record system is througing this error message.
    When i use same file loading from local workstation no error message
    I am thinking when  I FTP the file from AS/400 to BI Application Server(Linex) some invalid characters are adding but how can we track that invalid char?
    Gurus please share your thoughts on this I will assign full points.
    Thanks,

  • How to separate this hyperlink using function in Infopath?

    HI All,
    How to separate this hyperlink using function in Infopath?http://Site:90/Lists/attachment/Attachments/6/Capture.PNGhttp://Site:90/Lists/attachment/Attachments/6/Capture1.PNG
    Actually I have two fields
    in infopath form, attachment field and hyperlink field. If attachment attached, then set value for hyperlink field value as attachment link.
    When I attach more than one attachment, then hyperlink field value gets like above link. I need to separate into two link. How to achieve this?

    try this 
    substring(text, start_position, char_count)
    http://office.microsoft.com/en-us/infopath-help/add-formulas-and-functions-in-infopath-2010-HA101821255.aspx#_Text_functions
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • How to separate two mixed things in Disc report

    Hi ,
    does anybody know how to separate job numbers in Disc report . I did a sorting and gave totals by all other fields but a main job have three diff jobcodes where two of them has to be in one group and third one needs to be separated to see the total amount spend on that job . Can anybody pls help me on this .
    Thanks
    Shruthi

    Hi,
    If you have this grouping in many reports then you should consider putting the grouping calculation in a folder in the EUL.
    You can sort the report using this calculation and set the sort type to be "Hidden" so that the calculation does not show in the report.
    Rod West

Maybe you are looking for

  • Visited links not changing color on iPad Safari or other browsers

    Hi, On my iPad, when I visite a site via an hyperlink and then go back to the initial page, the color of that link is not changing anymore like it is on my MacBook. For example, in Google search, the visited links don't turn violet and remains blue i

  • Anyone seeing form field display glitches in Safari 6?

    Things like text that disappears as you type (but it's really still there) in heavily styled form fields. Might be a CSS issue. It seems to crop up after running the app for several hours and can be helped by restarting.

  • Help my macbook pro 374

    I shutdown my macbook pro 374 about 22 days. then i open it, it work 'normal'... except I found the power adaptor LED dont light not green nor yellow... Just like dont work. and the battery is in low power then auto shutdown. Now still cant charge fr

  • Unchecked exceptions

    From a book: "When a class undergoes revision, it is not a violation of source or binary compatibility if an exported method is modified to throw additional unchecked exceptions. Suppose a class invokes a method from another, independently written cl

  • Trying to connect my Sharp TV to internet through Airport

    I have tried everyhing I know to connect my new Sharp TV to my home network.  i run the connection on the TV and it always says ' Home Network: Pass Internet:     Fail Then below it says Default Gateway failed to respond. I have never had a problem c