Re: String filtering



David Trudgett wrote:

It seems odd to do this:

       New_Str : Unbounded_String
         := To_Unbounded_String(Count(Str, Alphanumeric_Set));

if you're also going to do this:

New_Str := To_Unbounded_String("");

Append(New_Str, Element(Str, Char));

If you allocate the expected length (and not overwrite that with a null string), then you can use Replace_Element.


Is there some reason you're not doing this in place, using Delete? Is there some reason you're not doing this when you create the original string?

--
Jeff Carter
"You tiny-brained wipers of other people's bottoms!"
Monty Python & the Holy Grail
18
.



Relevant Pages

  • Re: Determining whether a string is a date, time, or date and time
    ... know whether to include the date, time, or both when submitting the data to ... The reason your suggestion will not work is because a Date ... included in the original String. ... you can check the .Date and .Time properties to determine the ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Can Our Observations Be Trusted?
    ... >> And thoousands of others added another 50 years to it, ... I never met any scientist who said he was pursueing a holy grail. ... > one set of laws to explain everything. ... And no reason is needed, ...
    (talk.origins)
  • Sobig.F, et al
    ... password and can then get access to the 'holy grail' if ... >I don't know much about computers but, ... >forest, it seems that many of the bad guys go after your ... Is there some reason these can't be ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Easy question about Character manipulation
    ... Martin Krischik wrote: ... There's no reason for Size to be an object, ... Jeff Carter ... "I soiled my armor, I was so scared." ...
    (comp.lang.ada)
  • Re: Users of the BON notation among Ada users ?
    ... BTW, it's Dijkstra. ... Jeff Carter ... but there's no reason ... why you folks shouldn't go out into the lobby ...
    (comp.lang.ada)