Extracting Whitespace from String

This is a discussion on Extracting Whitespace from String within the C++ Programming forums, part of the General Programming Boards category; Hi All, I'm trying to extract whitespace from a string that I've pulled from a text file. Here's the code: ...

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    47

    Extracting Whitespace from String

    Hi All,

    I'm trying to extract whitespace from a string that I've pulled from a text file. Here's the code:

    Code:
    fileLinePrice = fileLine.substr(30, 5);
    						while (loop < 5)
    	{
    							chr = inData.get(fileLinePrice);
    							   if (chr != ' ')
    	   {
    	          fileLinePrice2 = fileLinePrice2 + chr;
    	          loop++;
    							   }
    	}
    The get function is not working -- I get a bad &%#@ing class -- which I'm growing very impatient with.

    Anyway, any help would be appreciated.

    bob2509

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    47
    figured it out.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 04-25-2008, 02:45 PM
  2. Inheritance Hierarchy for a Package class
    By twickre in forum C++ Programming
    Replies: 7
    Last Post: 12-08-2007, 03:13 PM
  3. String Manipulation problems -_-
    By Astra in forum C Programming
    Replies: 5
    Last Post: 12-13-2006, 04:48 PM
  4. Replies: 4
    Last Post: 03-03-2006, 01:11 AM
  5. "Operator must be a member function..." (Error)
    By Magos in forum C++ Programming
    Replies: 16
    Last Post: 10-28-2002, 01:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21