<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'finding a singular W in a line of text' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'finding a singular W in a line of text' posted on the 'C and C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 01:07:36 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 01:07:36 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>finding a singular W in a line of text</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/334762/334762/finding-a-singular-w-in-a-line-of-text/</link>
      <description>Hi guys,&lt;br /&gt;
&lt;br /&gt;
Basically I am indexing through lines of text in a text file.&lt;br /&gt;
&lt;br /&gt;
I am looking to delete lines of text with a singular W in it with a space at either side. ie " W "&lt;br /&gt;
&lt;br /&gt;
I would delete this line if I could find it:-&lt;br /&gt;
&lt;br /&gt;
The cat sat on the W mat.&lt;br /&gt;
&lt;br /&gt;
The lines of text are read in as AnsiStrings&lt;br /&gt;
&lt;br /&gt;
AnsiString LineToCheck;&lt;br /&gt;
&lt;br /&gt;
if (LineToCheck.AnsiPos(" W ")&amp;gt;0)&lt;br /&gt;
   {&lt;br /&gt;
    Blah Blah Blah&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
 // this should find the above line but is doesn't. Any idea how I can overcome this ??&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Graham&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/334762/334762/finding-a-singular-w-in-a-line-of-text/</guid>
      <pubDate>Sun, 16 Apr 2006 11:14:54 -0700</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: finding a singular W in a line of text</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/334762/334770/re-finding-a-singular-w-in-a-line-of-text/#334770</link>
      <description>: Hi guys,&lt;br /&gt;
: &lt;br /&gt;
: Basically I am indexing through lines of text in a text file.&lt;br /&gt;
: &lt;br /&gt;
: I am looking to delete lines of text with a singular W in it with a space at either side. ie " W "&lt;br /&gt;
: &lt;br /&gt;
: I would delete this line if I could find it:-&lt;br /&gt;
: &lt;br /&gt;
: The cat sat on the W mat.&lt;br /&gt;
: &lt;br /&gt;
: The lines of text are read in as AnsiStrings&lt;br /&gt;
: &lt;br /&gt;
: AnsiString LineToCheck;&lt;br /&gt;
: &lt;br /&gt;
: if (LineToCheck.AnsiPos(" W ")&amp;gt;0)&lt;br /&gt;
:    {&lt;br /&gt;
:     Blah Blah Blah&lt;br /&gt;
:    }&lt;br /&gt;
: &lt;br /&gt;
:  // this should find the above line but is doesn't. Any idea how I can overcome this ??&lt;br /&gt;
: &lt;br /&gt;
: Thanks&lt;br /&gt;
: Graham&lt;br /&gt;
: &lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
Can you use strstr() to check for a substring in LineToCheck?&lt;br /&gt;
&lt;br /&gt;
Take Care,&lt;br /&gt;
Ed&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/334762/334770/re-finding-a-singular-w-in-a-line-of-text/#334770</guid>
      <pubDate>Sun, 16 Apr 2006 14:14:47 -0700</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: finding a singular W in a line of text</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/334762/334773/re-finding-a-singular-w-in-a-line-of-text/#334773</link>
      <description>: : Hi guys,&lt;br /&gt;
: : &lt;br /&gt;
: : Basically I am indexing through lines of text in a text file.&lt;br /&gt;
: : &lt;br /&gt;
: : I am looking to delete lines of text with a singular W in it with a space at either side. ie " W "&lt;br /&gt;
: : &lt;br /&gt;
: : I would delete this line if I could find it:-&lt;br /&gt;
: : &lt;br /&gt;
: : The cat sat on the W mat.&lt;br /&gt;
: : &lt;br /&gt;
: : The lines of text are read in as AnsiStrings&lt;br /&gt;
: : &lt;br /&gt;
: : AnsiString LineToCheck;&lt;br /&gt;
: : &lt;br /&gt;
: : if (LineToCheck.AnsiPos(" W ")&amp;gt;0)&lt;br /&gt;
: :    {&lt;br /&gt;
: :     Blah Blah Blah&lt;br /&gt;
: :    }&lt;br /&gt;
: : &lt;br /&gt;
: :  // this should find the above line but is doesn't. Any idea how I can overcome this ??&lt;br /&gt;
: : &lt;br /&gt;
: : Thanks&lt;br /&gt;
: : Graham&lt;br /&gt;
: : &lt;br /&gt;
: &lt;span style="color: Blue;"&gt;&lt;br /&gt;
: Can you use strstr() to check for a substring in LineToCheck?&lt;br /&gt;
: &lt;br /&gt;
: Take Care,&lt;br /&gt;
: Ed&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
Hi Ed, It would appear not. I think strstr() is for character strings and at this stage I cannot convert my ansistring LineToCheck into a character string to do the check. I can't understand why AnsiPos or Pos won't find the " W " correctly.&lt;br /&gt;
&lt;br /&gt;
Graham&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/334762/334773/re-finding-a-singular-w-in-a-line-of-text/#334773</guid>
      <pubDate>Sun, 16 Apr 2006 15:44:07 -0700</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: finding a singular W in a line of text</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/334762/334810/re-finding-a-singular-w-in-a-line-of-text/#334810</link>
      <description>: Hi Ed, It would appear not. I think strstr() is for character strings and at this stage I cannot convert my ansistring LineToCheck into a character string to do the check. I can't understand why AnsiPos or Pos won't find the " W " correctly.&lt;br /&gt;
: &lt;br /&gt;
: Graham&lt;br /&gt;
: &lt;br /&gt;
&lt;span style="color: Blue;"&gt;&lt;br /&gt;
Is it possible the case of the W or the spaces are being read oddly?  Have you tried seaching for other substrings?  You've probably tried these methods, but I'm trying to help from afar.  How about looking for the hex values of the spaces - \x20W\x20, as referenced in the first link below.  I know you've probably also scoured the web, but here are some Borland pages, if they may help:&lt;br /&gt;
&lt;br /&gt;
http://support.borland.com/thread.jspa?threadID=2046&amp;amp;tstart=90&lt;br /&gt;
&lt;a href="http://support.borland.com/thread.jspa?messageID=6024"&gt;http://support.borland.com/thread.jspa?messageID=6024&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.functionx.com/bcb/topics/strings.htm"&gt;http://www.functionx.com/bcb/topics/strings.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The last one has to do with C++ Builder, but maybe there's something to trigger a solution.&lt;br /&gt;
&lt;br /&gt;
Sorry I can't be of more help.  Good luck with it.&lt;br /&gt;
&lt;br /&gt;
Take Care,&lt;br /&gt;
Ed&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/334762/334810/re-finding-a-singular-w-in-a-line-of-text/#334810</guid>
      <pubDate>Mon, 17 Apr 2006 07:10:21 -0700</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: finding a singular W in a line of text</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/334762/334820/re-finding-a-singular-w-in-a-line-of-text/#334820</link>
      <description>: : Hi Ed, It would appear not. I think strstr() is for character strings and at this stage I cannot convert my ansistring LineToCheck into a character string to do the check. I can't understand why AnsiPos or Pos won't find the " W " correctly.&lt;br /&gt;
: : &lt;br /&gt;
: : Graham&lt;br /&gt;
: : &lt;br /&gt;
: &lt;span style="color: Blue;"&gt;&lt;br /&gt;
: Is it possible the case of the W or the spaces are being read oddly?  Have you tried seaching for other substrings?  You've probably tried these methods, but I'm trying to help from afar.  How about looking for the hex values of the spaces - \x20W\x20, as referenced in the first link below.  I know you've probably also scoured the web, but here are some Borland pages, if they may help:&lt;br /&gt;
: &lt;br /&gt;
: http://support.borland.com/thread.jspa?threadID=2046&amp;amp;tstart=90&lt;br /&gt;
: &lt;a href="http://support.borland.com/thread.jspa?messageID=6024"&gt;http://support.borland.com/thread.jspa?messageID=6024&lt;/a&gt;&lt;br /&gt;
: &lt;a href="http://www.functionx.com/bcb/topics/strings.htm"&gt;http://www.functionx.com/bcb/topics/strings.htm&lt;/a&gt;&lt;br /&gt;
: &lt;br /&gt;
: The last one has to do with C++ Builder, but maybe there's something to trigger a solution.&lt;br /&gt;
: &lt;br /&gt;
: Sorry I can't be of more help.  Good luck with it.&lt;br /&gt;
: &lt;br /&gt;
: Take Care,&lt;br /&gt;
: Ed&lt;/span&gt;&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
Thankyou Ed,&lt;br /&gt;
Headache over. Never worked with Hex before infact my programming is very rusty as I am updating a program I wrote years ago whilst studying c++. Thanks again for your help and patience, your a STAR!! &lt;img src="http://www.programmersheaven.com/images/Community/twink.gif" width="15" height="15" alt="" /&gt;&lt;br /&gt;
Regards&lt;br /&gt;
Graham&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/334762/334820/re-finding-a-singular-w-in-a-line-of-text/#334820</guid>
      <pubDate>Mon, 17 Apr 2006 11:48:27 -0700</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: finding a singular W in a line of text</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/334762/334859/re-finding-a-singular-w-in-a-line-of-text/#334859</link>
      <description>: : : Hi Ed, It would appear not. I think strstr() is for character strings and at this stage I cannot convert my ansistring LineToCheck into a character string to do the check. I can't understand why AnsiPos or Pos won't find the " W " correctly.&lt;br /&gt;
: : : &lt;br /&gt;
: : : Graham&lt;br /&gt;
: : : &lt;br /&gt;
: : &lt;span style="color: Blue;"&gt;&lt;br /&gt;
: : Is it possible the case of the W or the spaces are being read oddly?  Have you tried seaching for other substrings?  You've probably tried these methods, but I'm trying to help from afar.  How about looking for the hex values of the spaces - \x20W\x20, as referenced in the first link below.  I know you've probably also scoured the web, but here are some Borland pages, if they may help:&lt;br /&gt;
: : &lt;br /&gt;
: : http://support.borland.com/thread.jspa?threadID=2046&amp;amp;tstart=90&lt;br /&gt;
: : &lt;a href="http://support.borland.com/thread.jspa?messageID=6024"&gt;http://support.borland.com/thread.jspa?messageID=6024&lt;/a&gt;&lt;br /&gt;
: : &lt;a href="http://www.functionx.com/bcb/topics/strings.htm"&gt;http://www.functionx.com/bcb/topics/strings.htm&lt;/a&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : The last one has to do with C++ Builder, but maybe there's something to trigger a solution.&lt;br /&gt;
: : &lt;br /&gt;
: : Sorry I can't be of more help.  Good luck with it.&lt;br /&gt;
: : &lt;br /&gt;
: : Take Care,&lt;br /&gt;
: : Ed&lt;/span&gt;&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: Thankyou Ed,&lt;br /&gt;
: Headache over. Never worked with Hex before infact my programming is very rusty as I am updating a program I wrote years ago whilst studying c++. Thanks again for your help and patience, your a STAR!! &lt;img src="http://www.programmersheaven.com/images/Community/twink.gif" width="15" height="15" alt="" /&gt;&lt;br /&gt;
: Regards&lt;br /&gt;
: Graham&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Is it possible that the string is in Unicode while you are searching ASCII or something? You can detect that with a hex editor.&lt;br /&gt;
Btw, ever tried using regular expressions? Little hard to bite at at first, but once you get the hang of it, they're great to search strings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Greets,&lt;br /&gt;
Eric Goldstein&lt;br /&gt;
www.gvh-maatwerk.nl&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/334762/334859/re-finding-a-singular-w-in-a-line-of-text/#334859</guid>
      <pubDate>Tue, 18 Apr 2006 00:38:44 -0700</pubDate>
      <category>C and C++</category>
    </item>
  </channel>
</rss>