remove tags

Discussion in 'Ruby' started by Junkone, Nov 20, 2007.

  1. Junkone

    Junkone Guest

    how to remove the tags in teh data like this

    <OrderNumber>-04</OrderNumber> <CompressedCircuitNumber>00BLCA-000 </
    CompressedCircuitNumber> <WorkOrderIssueNumber>01</
    WorkOrderIssueNumber><DateCompleted>071119</DateCompleted>
    <TimeCompleted>122729</TimeCompleted>

    thanks for help
    Junkone, Nov 20, 2007
    #1
    1. Advertising

  2. Junkone

    Phrogz Guest

    On Nov 20, 10:59 am, Junkone <> wrote:
    > how to remove the tags in teh data like this
    >
    > <OrderNumber>-04</OrderNumber> <CompressedCircuitNumber>00BLCA-000 </
    > CompressedCircuitNumber> <WorkOrderIssueNumber>01</
    > WorkOrderIssueNumber><DateCompleted>071119</DateCompleted>
    > <TimeCompleted>122729</TimeCompleted>


    irb(main):001:0> str = "<OrderNumber>-04</OrderNumber>
    <CompressedCircuitNumber>00BLCA-000 </CompressedCircuitNumber>
    <WorkOrderIssueNumber>01</WorkOrderIssueNumber><DateCompleted>071119</
    DateCompleted> <TimeCompleted>122729</TimeCompleted>"

    irb(main):002:0> str.gsub %r{</?[^>]+>}, ''
    => "-04 00BLCA-000 01071119 122729"
    Phrogz, Nov 20, 2007
    #2
    1. Advertising

  3. Junkone

    Junkone Guest

    On Nov 20, 1:16 pm, Phrogz <> wrote:
    > On Nov 20, 10:59 am, Junkone <> wrote:
    >
    > > how to remove the tags in teh data like this

    >
    > > <OrderNumber>-04</OrderNumber> <CompressedCircuitNumber>00BLCA-000 </
    > > CompressedCircuitNumber> <WorkOrderIssueNumber>01</
    > > WorkOrderIssueNumber><DateCompleted>071119</DateCompleted>
    > > <TimeCompleted>122729</TimeCompleted>

    >
    > irb(main):001:0> str = "<OrderNumber>-04</OrderNumber>
    > <CompressedCircuitNumber>00BLCA-000 </CompressedCircuitNumber>
    > <WorkOrderIssueNumber>01</WorkOrderIssueNumber><DateCompleted>071119</
    > DateCompleted> <TimeCompleted>122729</TimeCompleted>"
    >
    > irb(main):002:0> str.gsub %r{</?[^>]+>}, ''
    > => "-04 00BLCA-000 01071119 122729"


    thanks a lot
    Junkone, Nov 21, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dean H. Saxe
    Replies:
    0
    Views:
    1,023
    Dean H. Saxe
    Jan 3, 2004
  2. Rob Nicholson
    Replies:
    3
    Views:
    715
    Rob Nicholson
    May 28, 2005
  3. Ranganath

    Custom Tags within Custom Tags.

    Ranganath, Oct 17, 2003, in forum: Java
    Replies:
    2
    Views:
    453
    Ranganath
    Oct 21, 2003
  4. Mike
    Replies:
    3
    Views:
    870
    Michael Borgwardt
    Jan 9, 2004
  5. A. Brinkmann
    Replies:
    2
    Views:
    1,072
    A. Brinkmann
    Apr 16, 2004
Loading...

Share This Page