Hello everyone,
I think in built-in C/C++ functions, there is no direct function call to
trim heading and trailing space characters, right? So, we have to implement
it manually by iterating the string to check character one by one.
Support not using MFC.
thanks in advance,
George 6 2986
>I think in built-in C/C++ functions, there is no direct function call to
>trim heading and trailing space characters, right? So, we have to implement it manually by iterating the string to check character one by one.
Support not using MFC.
George,
You're posing in a .Net group, so if you're using String ^, there is a
Trim method already.
If you're using native C++ using std:string, you might want to have a
look at the Boost library facilities which I believe have trim
facilities
( http://www.boost.org/doc/html/string...html#id1638126)
MFC's CString has its own Trim method built-in.
Dave
Thanks Dave,
I think there is no built-in trim functions in even STL string. Right?
regards,
George
"David Lowndes" wrote:
I think in built-in C/C++ functions, there is no direct function call to
trim heading and trailing space characters, right? So, we have to implement
it manually by iterating the string to check character one by one.
Support not using MFC.
George,
You're posing in a .Net group, so if you're using String ^, there is a
Trim method already.
If you're using native C++ using std:string, you might want to have a
look at the Boost library facilities which I believe have trim
facilities
(http://www.boost.org/doc/html/string...html#id1638126)
MFC's CString has its own Trim method built-in.
Dave
Hi Dave,
It is implemented by find_first_not_of and find_last_not_of of STL string,
no built-in functions.
regards,
George
"David Lowndes" wrote:
I think there is no built-in trim functions in even STL string. Right?
None that I'm aware of - hence the Boost suggestion. There's an
article on CodeProject too - http://www.codeproject.com/vcpp/stl/stdstringtrim.asp
Dave
>It is implemented by find_first_not_of and find_last_not_of of STL string,
>no built-in functions.
Yes, that's what the CodeProject article uses.
Dave
Thanks Dave,
I think there is no built-in trim function and the method described in
CodeProject seems to be the best way.
regards,
George
"David Lowndes" wrote:
It is implemented by find_first_not_of and find_last_not_of of STL string,
no built-in functions.
Yes, that's what the CodeProject article uses.
Dave This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Shabam |
last post by:
Is there a function in dotnet that allows me to trim user input so that:
1) It gets rid of leading/trailing spaces, tabs, newlines and whatever other
non-printing characters
2) Gets rid of all...
|
by: jose luis fernandez diaz |
last post by:
Hi,
Does any know a algorithm to strip heading and leading blank in a string ?
Tnansk,
Jose Luis
|
by: DrBob |
last post by:
gcc 3.3 MAC OS X.
I have a string that has trailing spaces in it that I want removed.
So i have a variable:
string x("abcd ");
x.trim() isn't an implemented method.
Is there a method I...
|
by: Alex Vassiliev |
last post by:
Hi all.
Just wanted to share two handy RegEx expressions to strips leading and
trailing white-space from a string, and to replace all repeated spaces,
newlines and tabs with a single space.
*...
|
by: Andy B |
last post by:
I've tried using Trim or RTrim to strip trailing space characters from
my data. When I check on the transformed data space characters are
still there.
We have an address table containing two...
| |
by: Durgesh Sharma |
last post by:
Hi All,
Pleas help me .I am a starter as far as C Language is concerned .
How can i Right Trim all the white spaces of a very long (2000 chars)
Charecter string ( from the Right Side ) ? or how...
|
by: Sascha Herpers |
last post by:
Hi,
what is the difference between the trim function and the trim
String-member?
As far as I see it, both return the trimmed string and leave the
original string unaltered.
Is any of the two...
|
by: Konstantinos Pachopoulos |
last post by:
Hi,
is there something corresponding to the java String.trim() method, ie
trim start and trailing space/tab chars from string?
say convert " asdf " to "asdf"?
Thnx
|
by: swengineer001 |
last post by:
Just looking for a few eyes on this code other than my own.
void TrimCString(char *str)
{
// Trim whitespace from beginning:
size_t i = 0;
size_t j;
while(isspace(str))
{
|
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,...
|
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,...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |