How do i Replace a character with a nul value
like this but this does not work
oNewString=oString.Replace('a','')
I Want to Replace a character with a NON Space
Thanks
DAve 11 1355
Realise that you are REMOVING the letter and not replacing it and all shall
be revealed on how to solve this problem ;)
"dave" <dv*****@sbcglobal.netwrote in message
news:88******************@newssvr29.news.prodigy.n et...
How do i Replace a character with a nul value
like this but this does not work
oNewString=oString.Replace('a','')
I Want to Replace a character with a NON Space
Thanks
DAve
Hi,
"dave" <dv*****@sbcglobal.netwrote in message
news:88******************@newssvr29.news.prodigy.n et...
How do i Replace a character with a nul value
What u meant with "null" ?
like this but this does not work
oNewString=oString.Replace('a','')
I Want to Replace a character with a NON Space
Your code does that, it replace 'a' with a NON space, more eactly it just
remove the 'a'
With what u want to replace it with?
Thanks Daniel...i Feel like a dummy......staring right in front of me.....
"Daniel" <no****@pokercat.co.ukwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Realise that you are REMOVING the letter and not replacing it and all
shall be revealed on how to solve this problem ;)
"dave" <dv*****@sbcglobal.netwrote in message
news:88******************@newssvr29.news.prodigy.n et...
>How do i Replace a character with a nul value
like this but this does not work oNewString=oString.Replace('a','') I Want to Replace a character with a NON Space
Thanks DAve
Remove works (as has been pointed out), but I frequently use Replace with
empty strings. I think it works with strings, but not chars....
Ethan
"dave" <dv*****@sbcglobal.netwrote in message
news:88******************@newssvr29.news.prodigy.n et...
How do i Replace a character with a nul value
like this but this does not work
oNewString=oString.Replace('a','')
I Want to Replace a character with a NON Space
Thanks
DAve
<"Ethan Strauss" <ethan dot strauss at Promega dot com>wrote:
Remove works (as has been pointed out), but I frequently use Replace with
empty strings. I think it works with strings, but not chars....
That's because there's no such thing as an "empty char".
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
code snippet
is the below the appropriate way to remove characters insid a sting or is
there a better solution
int iChr;
while ((iChr = oBufferOut.IndexOf('"'))>0)
{
oBufferOut=oBufferOut.Remove(iChr,1);
}
"dave" <dv*****@sbcglobal.netwrote in message
news:88******************@newssvr29.news.prodigy.n et...
How do i Replace a character with a nul value
like this but this does not work
oNewString=oString.Replace('a','')
I Want to Replace a character with a NON Space
Thanks
DAve
DaveP <dv*****@sbcglobal.netwrote:
code snippet
is the below the appropriate way to remove characters insid a sting or is
there a better solution
int iChr;
while ((iChr = oBufferOut.IndexOf('"'))>0)
{
oBufferOut=oBufferOut.Remove(iChr,1);
}
Yup - use oBufferOut.Replace ("\"", "");
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Thank Jon
Dave
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
DaveP <dv*****@sbcglobal.netwrote:
>code snippet
is the below the appropriate way to remove characters insid a sting or is there a better solution
int iChr;
while ((iChr = oBufferOut.IndexOf('"'))>0) { oBufferOut=oBufferOut.Remove(iChr,1); }
Yup - use oBufferOut.Replace ("\"", "");
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
use
Replace(strString,'a','NULL')
regards
kshitij kumar <ks**********@discussions.microsoft.comwrote:
use
Replace(strString,'a','NULL')
Which language are you thinking of here? The above isn't valid C#, as
'NULL' isn't a valid character literal - and you'd want to call the
Replace method *on* strString, not with strString as the first
parameter.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Krakatioison |
last post by:
My sites navigation is like this:
http://www.newsbackup.com/index.php?n=000000000040900000
, depending on the variable "n" (which is always a number), it will take me
anywhere on the site......
|
by: Stu Cazzo |
last post by:
I have the following:
String myStringArray;
String myString = "98 99 100";
I want to split up myString and put it into myStringArray.
If I use this:
myStringArray = myString.split(" ");
it...
|
by: John F Dutcher |
last post by:
I use code like the following to retrieve fields from a form:
recd =
recd.append(string.ljust(form.getfirst("lname",' '),15))
recd.append(string.ljust(form.getfirst("fname",' '),15))
etc.,...
|
by: Derek Hart |
last post by:
I wish to execute code from a string. The string will have a function name,
which will return a string:
Dim a as string
a = "MyFunctionName(param1, param2)"
I have seen a ton of people...
|
by: Angus Leeming |
last post by:
Hello,
Could someone explain to me why the Standard conveners chose to typedef
std::string rather than derive it from std::basic_string<char, ...>?
The result of course is that it is...
| |
by: Kevin C |
last post by:
Quick Question:
StringBuilder is obviously more efficient dealing with string concatenations
than the old '+=' method... however, in dealing with relatively large string
concatenations (ie,...
|
by: Andrew |
last post by:
I have written two classes : a String Class based on the book " C++ in
21 days " and a GenericIpClass listed below :
file GenericStringClass.h
// Generic String class
|
by: s |
last post by:
I'm getting compile errors on the following code:
<code>
#include <iostream>
#include <fstream>
#include <list>
#include <string>
using namespace std;
|
by: Christopher Benson-Manica |
last post by:
Let's say I have a std::string, and I want to replace all the ','
characters with " or ", i.e. "A,B,C" -> "A or B or C". Is the
following the best way to do it?
int idx;
while(...
|
by: Steve |
last post by:
Hi Guys,
I have a string which contains data elements separated by spaces. I also
have a function which returns the number of characters from the beginning of
the string for a given number of...
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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: 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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |