473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

beginer

how can I write program who removes all ' ' from the string?

dl
Jul 19 '05 #1
3 1592
On Tue, 9 Sep 2003 15:52:16 +0200, "Darko Lapanje" <zr*@hotmail.com> wrote:
how can I write program who removes all ' ' from the string?


There are ways that for an experienced programmer would be easier,
but as a novice, translate to C++:
1) Obtain string s from e.g. program arguments or user, or
simply set it to a well-known test value like "steak brandy cigar".

2) Set string t to empty.

3) For each character position i in s, in ascending order:
{
Let c be character number i in s.
If c is different from a space, then
{
Append c to the end of t.
}
}
Jul 19 '05 #2
"Darko Lapanje" <zr*@hotmail.com> wrote in message
news:bj**********@planja.arnes.si...
how can I write program who removes all ' ' from the string?


There was actually a thread about this a couple of weeks ago:

http://tinyurl.com/mqge

Regards,

Russell Hanneken
rh*******@pobox.com
Jul 19 '05 #3
"Darko Lapanje" <zr*@hotmail.com> wrote in message
news:bj**********@planja.arnes.si...
how can I write program who removes all ' ' from the string?

dl


s.erase(std::remove_if(s.begin(), s.end(),
std::bind2nd(std::equal_to<char>(), ' ')), s.end());

HTH,

Stuart.
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim | last post by:
Hi all, I am new to SOAP and Python. I am practicing learning SOAP with Python. I sent a request and I got the following response: <SOAPpy.Types.structType HashStringResponse at 23909440>: {}
7
by: scott289 | last post by:
I have successfully downloaded the Enterprise Library and the data access block (C#). I am able to compile and run the quickstart application. So I would like to try the DAB in a new project....
7
by: vee_kay | last post by:
Is there any simpler forum for C++. I feel this forum is advanced for a begineer
3
by: ibm_97 | last post by:
Session 1: $db2 +c db2 => set current isolation = UR db2 => select * from t T1 ------ ABC
5
by: Prem Mallappa | last post by:
Hi everybody here is my code to print all nonblank character on Input.. This program according to my knowledge should run till i press Ctrl+D but,,, this is parsing the input untill i press...
1
by: itsjyotika | last post by:
Hello Everyone, I need to read data from a CVS file(i created it from micosoft excel) and then need to match it with the one of the date from the command line.If the date is there then it should say...
5
by: hn.ft.pris | last post by:
Hi: I'm a beginer of STL, and I'm wondering why none of below works: ######################################################################## .......... string str("string"); if ( str == "s" )...
1
by: hamed steph | last post by:
i'm a beginer in programing and i need very much your help .i need explanation about while statement (loop initialization and structure of while ) also qualifier (long,short,unsigned ,signed,) type...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.