How to remove /delete a particular character in a String

Hii
i have this problem.In order to specify the number of decimal palces for a double type variable,i have used the
NumberFormat class.
My code ;
Double x=234566.4 ;
NumberFormat n1= NumberFormat.getInstance();
n1.setMaximumFractionDigits(2);
n1.setMinimumFractionDigits(2);
String st=n1.format(x);
out.print(st) ;
is giving me 2,34,566.40 which I dont want I want to have it lik 234566.40
since i will again put it in function Integer.parseInt/Double.parseDouble...so those commas are giving me errors.So can anybody suggest how to remove those commas from that string...It would be of gr8 help.thanx
Arnab

hi
You can use StringTokenizer
Your code
Double x=234566.4 ;
NumberFormat n1= NumberFormat.getInstance();
n1.setMaximumFractionDigits(2);
n1.setMinimumFractionDigits(2);
String st=n1.format(x);
out.print(st) ;
StringTokenizer sT = new StringTokenizer(st,",");
String newstring="";
while(sT.hasMoreTokens())
newstring += sT.nextToken();
out.println(newstring);
this may help out
cheers
rambee

Similar Messages

  • Nokia 6060...How do i delete a single character ?

    When composing a text message, if i make a mistake i can't seem to delete a single character. The only option i have is to return to the main menu and start again. How do i delete a single character ?
    TIA for any replies.

    Hi You just press the c button on the right hand side of the phone each time you want to delete a caracter

  • How to search for a particular word in a string?

    How to search for a particular word in a string?
    thanks for your help....

    This works fine.
    public class Foo {
        public static void main(String[] args) {
        String s = "Now is the time for all good...";
        String s2 = "the time";
        System.out.println(s.contains(s2));
        System.out.println(s.contains("for al"));
        System.out.println(s.contains("not here"));
    }output:true
    true
    falseYou must have something else wrong in your code.
    JJ

  • How to search for a particular pattern in a string

    Hi,

    Hi ,
    How to search for a particular pattern in a string?
    I heard about java.util.regex; and used it in my jsp program.
    Program I used:
    <% page import="java.util.regex"%>
    <% boolean b=Pattern.matches("hello world","hello");
    out.println(b);%>
    I run this program using netbeans and am getting the following error message.
    "Cannot find the symbol : class regex"
    "Cannot find the symbol : variable Pattern "
    How to correct the error?

  • How we can find the last character in a string(Urgent Plz!)

    Gurus!
    How we can find the last character in a string.
    e.g i have a string say "Str" with value "10-01".
    Now i want to find the last character in "Str" i.e "ONE=1".
    i am using Oracle developer 6i with Oracle 8i(1.7).
    Plz help!
    Many thanks!

    Use the substr() and length() functions -
    x := '10-01';
    y := substr(x, length(x));

  • How to remove/delete from a mysql table

    Hello!
    Please can someone help me with this one; I need to remove/delete a a row in a mysql table. When I use the query below, it removes this line from other tables containing the same numbers too. I only want to remove it from this table alone
    String update= ("DELETE FROM info WHERE Number = '" + Nr + "' AND week= " + week+ ");
    THX

    I don't understand this. You're saying that running this query removes values from other tables besides your info table? I don't believe it.
    One thing I'd caution you on is using names like "info" and "number" for tables and columns. They sound suspiciously close to keywords for your database. You'd be better off using less generic, more application specific names.
    But I don't think that explains the behavior you're describing. Either this is a very serious bug in MySQL or a very serious misunderstanding on your part.

  • How to remove deletion of asset from Asset Histrory

    Hi Experts
    In my project there are some assets created and some transcations are posted and reversed back
    since those assets are created by mistake, they should not come into asset history
    can you please tell me how to remove those assets from asset histroy
    Regards
    Sreenivasulu

    Hi,
    this should be possible by using AS06 and deletinge these assets. Please note you need to set deactivation date in AS02 first.
    Hope this helps,
    Luana

  • How to remove(Delete) multiple agents from SCOM console

    Hello Experts,
    We are using scom 2012 and monitoring around 10000 agents in our environment.  Now Windows team decomissioned around 1000 server/clients and we need to remove those agents(grayed agents) from console.
    It is very difficult to find and delete the agent one by one.  Is there any script to remove/delete the agent from console?
    Thanks in advance.
    Regards
    Karthick

    Hi,
    In addition,several ways to remove SCOM agent if SCOM console fails.
    1. Add/Remove Programs (appwiz.cpl)
    2. Run (MsiExec.exe /uninstall {E7600A9C-6782-4221-984E-AB89C780DC2D} /quiet)
    3. psexec -d MsiExec.exe /uninstall {E7600A9C-6782-4221-984E-AB89C780DC2D} /quiet *
    Here are some links about using PowerShell remove Agents:
    - http://support.micro...b/2626752/en-us
    -  http://technet.micro...y/hh545186.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • HT3384 how to remove (delete) shapes from pages document or move them once they are in place

    How can I delete or move a shape once I put it in a document?

    If you are having trouble selecting the shape, try holding down the command key and clicking on its edge so you see the corner selection boxes, then hit the Delete key.
    Peter

  • How to remove only the last element of spreadsheet string

    I use path to string option to store image path into database and while retrieving the string is again converted into path but it gives out an error as the output of array to spreadsheet string gives out a tab at the end which is unable for the IMAQ read file to recognise.but when i use the path of the image directly into IMAQ readfile the image is opened . so how to remove the tab only at the end of output of the spreadsheet string(whose length can vary)? I have also attached my program with this.
    Attachments:
    retrieve_images_from_DB.vi ‏65 KB
    file_path_to_db_(images).vi ‏40 KB
    create_table_for_images.vi ‏45 KB

    indhu wrote:
    > Thanks for your reply!
    > But my problem is to remove only the last element(which is a tab or an
    > alphabet) from a spreadsheet string of any length.
    If you just want to remove the last character of a string just use the
    String Size function reduce the result by one and wire it together with
    the string to the Split String function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to find out the repeated character in a string value?

    Dear People,
    I want to trace out the names where a character occured more than once.for ex, i need o/p as
    ENAME
    ALLEN
    TURNER
    ADAMS
    In which all the above name consists of repeated characters.
    I use Oracle 10g and i tried using REGEXP say for ex,
    SELECT ENAME FROM EMP WHERE REGEXP_LIKE(ENAME,'L{2}');
    ENAME
    ALLEN
    MILLERbut this works only for single character.how to specify condition for any character?.pls suggest me.
    With Regards
    VIDS

    Here is one way you can use from version 10 upwards:
    SQL> with emp as
      2  ( select 7369 empno, 'SMITH' ename, 'CLERK' job, 7902 mgr, date '1980-12-17' hiredate, 800 sal, NULL comm, 20 deptno from dual union all
      3    select 7499, 'ALLEN', 'SALESMAN', 7698, date '1981-02-20', 1600, 300, 30 from dual union all
      4    select 7521, 'WARD', 'SALESMAN', 7698, date '1981-02-22', 1250, 500, 30 from dual union all
      5    select 7566, 'JONES', 'MANAGER', 7839, date '1981-04-02', 2975, NULL, 20 from dual union all
      6    select 7654, 'MARTIN', 'SALESMAN', 7698, date '1981-09-28', 1250, 1400, 30 from dual union all
      7    select 7698, 'BLAKE', 'MANAGER', 7839, date '1981-05-01', 2850, NULL, 30 from dual union all
      8    select 7782, 'CLARK', 'MANAGER', 7839, date '1981-06-09', 2450, NULL, 10 from dual union all
      9    select 7788, 'SCOTT', 'ANALYST', 7566, date '1982-12-09', 3000, NULL, 20 from dual union all
    10    select 7839, 'KING', 'PRESIDENT', NULL, date '1981-11-17', 5000, NULL, 10 from dual union all
    11    select 7844, 'TURNER', 'SALESMAN', 7698, date '1981-09-08', 1500, 0, 30 from dual union all
    12    select 7876, 'ADAMS', 'CLERK', 7788, date '1983-01-12', 1100, NULL, 20 from dual union all
    13    select 7900, 'JAMES', 'CLERK', 7698, date '1981-12-03', 950, NULL, 30 from dual union all
    14    select 7902, 'FORD', 'ANALYST', 7566, date '1981-12-03', 3000, NULL, 20 from dual union all
    15    select 7934, 'MILLER', 'CLERK', 7782, date '1982-01-23', 1300, NULL, 10 from dual
    16  )
    17  select ename
    18       , e
    19       , count(*)
    20    from ( select ename
    21                , e
    22             from emp
    23            model
    24                  return updated rows
    25                  partition by (ename)
    26                  dimension by (0 i)
    27                  measures (ename e)
    28                  ( e[for i from 1 to length(e[0]) increment 1] = substr(e[0],cv(i),1)
    29                  )
    30         )
    31   group by ename
    32       , e
    33  having count(*) > 1
    34  /
    ENAME  E        COUNT(*)
    SCOTT  T               2
    MILLER L               2
    ADAMS  A               2
    ALLEN  L               2
    TURNER R               2
    5 rows selected.Regards,
    Rob.

  • How to get a set of character within a string?

    Hi,
    I need to cut a set of character within a string. I have tried everthing but I need help.
    Example.
    Database Version 11.2.0.3
    create table tst_string (message varchar2(600));
    insert into tst_string values ('ANR0166I Inventory file expiration finished processing for node OSOGBO, filespace OSOGBO\SystemState, copygroup BACKUP and object type GROUP BASE with processing statistics: examined 43, deleted 43, retrying 0, and failed 0. (SESSION: 1506, PROCESS: 2)');
    insert into  tst_string values ('ANE4175I Starting Full VM restore of VMware Virtual Machine ''mfujiwara'' target node name=''VC1_DC1'', data mover node name=''VC1_DC1_DM3''  (SESSION: 3780)');
    commit;
    select * from tst_string;
    MESSAGE
    ANR0166I Inventory file expiration finished processing for node OSOGBO, filespace OSOGBO\SystemState, copygroup BACKUP and object type GROUP BASE with processing statistics: examined 43, deleted 43, retrying 0, and failed 0. (SESSION: 1506, PROCESS: 2)
    ANE4175I Starting Full VM restore of VMware Virtual Machine 'mfujiwara' target node name='VC1_DC1', data mover node name='VC1_DC1_DM3'  (SESSION: 3780)
    ## I want get
    # From first line following values:
    node OSOGBO
    filespace OSOGBO\SystemState
    examined 43
    deleted 43
    retrying 0
    failed 0
    # From second line
    mfujiwara
    VC1_DC1
    VC1_DC1_DM3Any help can be useful...
    Thanks in advance.

    Hi Frank,
    It looks like message can be seen as delimited lsit of sub-messages, where a number of different characters (perhaps ',' amd ':') may serve as delimiters. Each sub-message may or consist (entirely or in part) of something you want to display.Yes. In my first case where is "ANR0166I" I want get the characteres before "," (e.g "OSOGBO," I want get "OSOGBO") excluding "(SESSION: 1506, PROCESS: 2)"
    Would a user-define PL/SQL function be okay for you?Yes.. no problem.
    I'm not good with shell script, but will try show what I want using SHELL commands:
    See this example:
    ### I create a file named "tst_string"
    $ vi tst_string
    ANR0166I Inventory file expiration finished processing for node OSOGBO, filespace OSOGBO\SystemState\NULL\System State\SystemState, copygroup BACKUP and object type GROUP BASE with processing statistics: examined 43, deleted 43, retrying 0, and failed 0. (SESSION: 1506, PROCESS: 2)
    ## So I used a function sed to get my desired values. The command bellow is poor, but My point is the result.
    $ cat tst_string | sed 's/ANR0166I.*node //g' | sed 's/, filespace//g' | sed 's/, copygroup BACKUP and object type GROUP BASE with processing statistics: //g' | sed 's/. (SESSION.*//g' | sed 's/, deleted//g' | sed 's/, retrying//g' | sed 's/, and failed//g'
    OSOGBO OSOGBO\SystemState\NULL\System State\SystemState 43 43 0 0The result was:
    NODE     FILESPACE                              Examined     Deleted     Retrying        Failed      
    OSOGBO      OSOGBO\SystemState\NULL\System State\SystemState     43           43      0           0I will go check the links wich you mentioned.
    Thanks

  • How to remove (delete) FB contacts from the contact list.

    I'm really new to my new Mac and having a bit of trouble trying to delete all the contacts that were downloaded to my contact list from Facebook. I have tried highlighting one and deleting it that way, but, the 'Remove from Group' doesn't light up.
    I tried putting them in a particular group, such as FB contacts, then deleting that group. But, they still remain in the group titles 'All on My Mac'. How do I get them deleted from that group??

    To turn off Facebook contacts:
    1) Go to Contacts
    2) Click Group on the top
    3) Uncheck All Facebook
    Then you shuold just see your regular contacts.
    Good luck.
    Mr Bill

  • When I click on an email with a particular attached photo, it freezes -how can I delete this particular email?

    Someone sent me a photo as an attachment. When I click on the email, TB freezes. I can't do anything. The first time she sent it, it went to a folder and I just deleted the folder, but she sent it again and it went into my inbox. How can I remove this email from my inbox? The minute I click on that email, TB freezes so I can't delete it. TB is still running when I check the processes.

    I could not do that. As soon as I clicked the message, TB froze so I could not right-click or anything. As it happens, I just tired selecting the email before it and the email after it and then deleted all 3 and that worked. Thanks so much for your suggestion though.

  • How to remove/delete Ovi Maps completely

    Hello, I would like to remove this application from my mobile phone. How can I do it?

    starach wrote:
    Hello, I would like to remove this application from my mobile phone. How can I do it?
    Unfortunately you can't remove this application which is pre-installled in device firmware, although you can delete contents of E:\Cities if you no longer wish to use it.
    Happy to have helped forum with a Support Ratio = 42.5

Maybe you are looking for

  • ShortDump in PCUI Sales Order Application

    Hi,    Installed BP for CRM on ep 6.0 sp12 , crm 4.0 sp9 and assigned a Interaction center manager role to an user. and 1. went to sales order application 2. selected a sales order 3. in the detail area, selected payment form tab 4. F4 help on card n

  • Adaptive Agent won't install for TP1

    ZCM 11, TP1 I'm using a clean Windows XP SP2 Pro machine. It's not patched or fully updated. I tried using the 300 MB agent complete dot net install (I ASSUME that's the one that has the .net 3.5.1 that's required) I get a DOS box that pops up and th

  • Practical limit of number of rows in collections

    Hi I use Apex3 and am thinking of using collections to solve a problem. The issue is, though in average each operation will create less than 1000 rows, there may be cases where as many as 100k rows will need to be created (but they will be very rare)

  • Using Loader.loadBytes - specify SecurityDomain for loaded swf?

    Hi i have a problem. I use Loader.loadBytes to dynamically load a swf into my app (i use this method to load modules into the app). My trouble is that when I want to use ExternalInterface.addCallback to allow js calls on my app. When those functions

  • Can i turn off icon labels in Symbian ^3 on my N8?

    just updated my N8 from anna to belle and my first inclination is to turn off what was originally called tool tips, or the superfluous labels underneath each icon in the GUI.  i mean isn't that what the G stands for - Graphical?  the Nokia representa