Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   remove tags (http://www.velocityreviews.com/forums/t845930-remove-tags.html)

Junkone 11-20-2007 05:59 PM

remove tags
 
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

Phrogz 11-20-2007 06:16 PM

Re: remove tags
 
On Nov 20, 10:59 am, Junkone <junko...@gmail.com> 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"

Junkone 11-21-2007 11:48 PM

Re: remove tags
 
On Nov 20, 1:16 pm, Phrogz <phr...@mac.com> wrote:
> On Nov 20, 10:59 am, Junkone <junko...@gmail.com> 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


All times are GMT. The time now is 03:43 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.