Hi,
I know this has been asked before, but reading the threads it is still not
entirely clear.
Deciding which .Replace( ) to use when.
Typically if I create a string in a loop I always use a StringBuilder. At
present I am
porting a VB6 webclass app to VB.NET and therefore I am trying to make it as
efficent as possible via the new functionality of VB.NET.
At present I have (in various places):
variableX = variableX.Replace("a string", "another string")
In some cases the above variableX will have 4+ replaces virutally one after
the
other with 1 or 2 of the replacement strings having length > 100.
This seems like the perfect candidate for StringBuilder.Replace instead of
String.Replace
what does anybody think?
Regards,
Pete 9 8937
Hi,
When you use variableX = variableX.Replace("a string", "another
string") with a string it will it will create a new string in memory and
destroy the old one. The stringbuilder will reuse the memory space
therefore it is quicker. http://msdn.microsoft.com/library/de...ilderclass.asp
Ken
----------------------
"Peter Row" <pe*******@oxfordcc.co.uk> wrote in message
news:eV**************@TK2MSFTNGP09.phx.gbl... Hi,
I know this has been asked before, but reading the threads it is still not entirely clear. Deciding which .Replace( ) to use when.
Typically if I create a string in a loop I always use a StringBuilder. At present I am porting a VB6 webclass app to VB.NET and therefore I am trying to make it as efficent as possible via the new functionality of VB.NET.
At present I have (in various places): variableX = variableX.Replace("a string", "another string")
In some cases the above variableX will have 4+ replaces virutally one after the other with 1 or 2 of the replacement strings having length > 100.
This seems like the perfect candidate for StringBuilder.Replace instead of String.Replace what does anybody think?
Regards, Pete
Hi,
The link provided gives a lot of info but leaves out some important info
hence the original question.
If I have a stringbuilder and lets say it has length = 100, I also have
strHeaderStuff with length = 200.
For the sake of argument lets also say that .IndexOf("<head>") is 25 and I
say:
MyStrBldr.Replace("<head>", strHeaderStuff)
The stringbuilder object is increasing it's size and inserting at a position
it has to find first.
So I still need to be convinced that doing it this way will be faster than
doing:
SimpleString = SimpleString.Replace("<head>", strHeaderStuff)
I don't wanna start a massive flaming debate about the rights and wrongs of
anything but...
wouldn't it of made more sense for MS to implement the String type to do the
same as a
StringBuilder under the covers and hence not have StringBuilder?
i.e
Dim str As String
Str = "Hello"
Str &= " World"
Is roughly the same as saying:
Dim sbr As New StringBuilder
sbr.Append("Hello")
sbr.Append(" World")
So if the stringbuilder is so much more efficent why not simply implement
the String that way
in the first place?
Regards,
Peter
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl... Hi,
When you use variableX = variableX.Replace("a string", "another string") with a string it will it will create a new string in memory and destroy the old one. The stringbuilder will reuse the memory space therefore it is quicker.
http://msdn.microsoft.com/library/de...ilderclass.asp Ken ---------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:eV**************@TK2MSFTNGP09.phx.gbl... Hi,
I know this has been asked before, but reading the threads it is still
not entirely clear. Deciding which .Replace( ) to use when.
Typically if I create a string in a loop I always use a StringBuilder.
At present I am porting a VB6 webclass app to VB.NET and therefore I am trying to make
it as efficent as possible via the new functionality of VB.NET.
At present I have (in various places): variableX = variableX.Replace("a string", "another string")
In some cases the above variableX will have 4+ replaces virutally one after the other with 1 or 2 of the replacement strings having length > 100.
This seems like the perfect candidate for StringBuilder.Replace instead
of String.Replace what does anybody think?
Regards, Pete
Hi Peter,
Only an answer on your question,
I asume that making a string as dim mystring as String = "Peter" with the
stringbuilder is a little bit overdone.
But nobody is keeping you from doing it with stringbuilder, that is what I
find so nice from VB.net, you can make your own decissions how you do it.
When that is gone you can take a tool as Access.
But just my thought,
Cor
Hi,
The stringbuilder will only resize if the string is larger.
Ken
---------------------
"Peter Row" <pe*******@oxfordcc.co.uk> wrote in message
news:Ow**************@TK2MSFTNGP10.phx.gbl... Hi,
The link provided gives a lot of info but leaves out some important info hence the original question.
If I have a stringbuilder and lets say it has length = 100, I also have strHeaderStuff with length = 200. For the sake of argument lets also say that .IndexOf("<head>") is 25 and I say:
MyStrBldr.Replace("<head>", strHeaderStuff)
The stringbuilder object is increasing it's size and inserting at a position it has to find first. So I still need to be convinced that doing it this way will be faster than doing:
SimpleString = SimpleString.Replace("<head>", strHeaderStuff)
I don't wanna start a massive flaming debate about the rights and wrongs of anything but... wouldn't it of made more sense for MS to implement the String type to do the same as a StringBuilder under the covers and hence not have StringBuilder?
i.e Dim str As String Str = "Hello" Str &= " World"
Is roughly the same as saying: Dim sbr As New StringBuilder sbr.Append("Hello") sbr.Append(" World")
So if the stringbuilder is so much more efficent why not simply implement the String that way in the first place?
Regards, Peter
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:OA**************@TK2MSFTNGP12.phx.gbl... Hi,
When you use variableX = variableX.Replace("a string", "another string") with a string it will it will create a new string in memory and destroy the old one. The stringbuilder will reuse the memory space therefore it is quicker.
http://msdn.microsoft.com/library/de...ilderclass.asp Ken ---------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:eV**************@TK2MSFTNGP09.phx.gbl... > Hi, > > I know this has been asked before, but reading the threads it is still not > entirely clear. > Deciding which .Replace( ) to use when. > > Typically if I create a string in a loop I always use a StringBuilder. At > present I am > porting a VB6 webclass app to VB.NET and therefore I am trying to make it > as > efficent as possible via the new functionality of VB.NET. > > At present I have (in various places): > variableX = variableX.Replace("a string", "another string") > > In some cases the above variableX will have 4+ replaces virutally one > after > the > other with 1 or 2 of the replacement strings having length > 100. > > This seems like the perfect candidate for StringBuilder.Replace instead of > String.Replace > what does anybody think? > > Regards, > Pete > >
Hi,
Eh? I don't get what you are saying?
If I have a SBuilder with length 100 and I replace "<head>" (length 6) with
a string
that is 200 in length then the Sbuilder has no choice but to resize surely;
because
you are replacing 6 out of 100 with 200 hence the length after the replace
would be
294 which is 194 larger than before the operation??
Therefore since it is resizing it then you'd assume there is some overhead
to that.
So how does that overhead compare to doing a :
Str = Str.Replace("<head>", str2)
Regards,
Peter
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
The stringbuilder will only resize if the string is larger.
Ken --------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:Ow**************@TK2MSFTNGP10.phx.gbl... Hi,
The link provided gives a lot of info but leaves out some important info hence the original question.
If I have a stringbuilder and lets say it has length = 100, I also have strHeaderStuff with length = 200. For the sake of argument lets also say that .IndexOf("<head>") is 25 and
I say:
MyStrBldr.Replace("<head>", strHeaderStuff)
The stringbuilder object is increasing it's size and inserting at a position it has to find first. So I still need to be convinced that doing it this way will be faster
than doing:
SimpleString = SimpleString.Replace("<head>", strHeaderStuff)
I don't wanna start a massive flaming debate about the rights and wrongs of anything but... wouldn't it of made more sense for MS to implement the String type to do the same as a StringBuilder under the covers and hence not have StringBuilder?
i.e Dim str As String Str = "Hello" Str &= " World"
Is roughly the same as saying: Dim sbr As New StringBuilder sbr.Append("Hello") sbr.Append(" World")
So if the stringbuilder is so much more efficent why not simply
implement the String that way in the first place?
Regards, Peter
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:OA**************@TK2MSFTNGP12.phx.gbl... Hi,
When you use variableX = variableX.Replace("a string", "another string") with a string it will it will create a new string in memory
and destroy the old one. The stringbuilder will reuse the memory space therefore it is quicker.
http://msdn.microsoft.com/library/de...ilderclass.asp Ken ---------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:eV**************@TK2MSFTNGP09.phx.gbl... > Hi, > > I know this has been asked before, but reading the threads it is
still not > entirely clear. > Deciding which .Replace( ) to use when. > > Typically if I create a string in a loop I always use a
StringBuilder. At > present I am > porting a VB6 webclass app to VB.NET and therefore I am trying to
make it > as > efficent as possible via the new functionality of VB.NET. > > At present I have (in various places): > variableX = variableX.Replace("a string", "another string") > > In some cases the above variableX will have 4+ replaces virutally one > after > the > other with 1 or 2 of the replacement strings having length > 100. > > This seems like the perfect candidate for StringBuilder.Replace
instead of > String.Replace > what does anybody think? > > Regards, > Pete > >
Hi,
The point I was making was that since when dealing with Strings that are
appended
and replaced over and over the stringbuilder is more efficent then why
bother
making the distinction.
All it does is give you a pointless decision which in some cases is very
close.
It boils down to this:
Do you want your app to run fast/efficently or run okay/more-or-less
efficent?
Well I would always choose fast/efficently as I'm sure most people would,
therefore
why complicate the issue by having String and StringBuilder? Why not just
have
String which works like StringBuilder under the covers?
Finally don't be so digusting!!! Mentioning MS Access, urrgghh!
Regards,
Peter
"Cor" <no*@non.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... Hi Peter,
Only an answer on your question,
I asume that making a string as dim mystring as String = "Peter" with the stringbuilder is a little bit overdone.
But nobody is keeping you from doing it with stringbuilder, that is what I find so nice from VB.net, you can make your own decissions how you do it.
When that is gone you can take a tool as Access.
But just my thought,
Cor
Hi,
I guess in that case there would be no real improvement.
Ken
-----------
"Peter Row" <pe*******@oxfordcc.co.uk> wrote in message
news:es**************@tk2msftngp13.phx.gbl... Hi,
Eh? I don't get what you are saying?
If I have a SBuilder with length 100 and I replace "<head>" (length 6) with a string that is 200 in length then the Sbuilder has no choice but to resize surely; because you are replacing 6 out of 100 with 200 hence the length after the replace would be 294 which is 194 larger than before the operation??
Therefore since it is resizing it then you'd assume there is some overhead to that. So how does that overhead compare to doing a : Str = Str.Replace("<head>", str2)
Regards, Peter "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
The stringbuilder will only resize if the string is larger.
Ken --------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:Ow**************@TK2MSFTNGP10.phx.gbl... > Hi, > > The link provided gives a lot of info but leaves out some important > info > hence the original question. > > If I have a stringbuilder and lets say it has length = 100, I also have > strHeaderStuff with length = 200. > For the sake of argument lets also say that .IndexOf("<head>") is 25 > and I > say: > > MyStrBldr.Replace("<head>", strHeaderStuff) > > The stringbuilder object is increasing it's size and inserting at a > position > it has to find first. > So I still need to be convinced that doing it this way will be faster than > doing: > > SimpleString = SimpleString.Replace("<head>", strHeaderStuff) > > I don't wanna start a massive flaming debate about the rights and > wrongs > of > anything but... > wouldn't it of made more sense for MS to implement the String type to > do > the > same as a > StringBuilder under the covers and hence not have StringBuilder? > > i.e > Dim str As String > Str = "Hello" > Str &= " World" > > Is roughly the same as saying: > Dim sbr As New StringBuilder > sbr.Append("Hello") > sbr.Append(" World") > > So if the stringbuilder is so much more efficent why not simply implement > the String that way > in the first place? > > Regards, > Peter > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:OA**************@TK2MSFTNGP12.phx.gbl... >> Hi, >> >> When you use variableX = variableX.Replace("a string", >> "another >> string") with a string it will it will create a new string in memory and >> destroy the old one. The stringbuilder will reuse the memory space >> therefore it is quicker. >> >> > http://msdn.microsoft.com/library/de...ilderclass.asp >> >> Ken >> ---------------------- >> "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message >> news:eV**************@TK2MSFTNGP09.phx.gbl... >> > Hi, >> > >> > I know this has been asked before, but reading the threads it is still > not >> > entirely clear. >> > Deciding which .Replace( ) to use when. >> > >> > Typically if I create a string in a loop I always use a StringBuilder. > At >> > present I am >> > porting a VB6 webclass app to VB.NET and therefore I am trying to make > it >> > as >> > efficent as possible via the new functionality of VB.NET. >> > >> > At present I have (in various places): >> > variableX = variableX.Replace("a string", "another string") >> > >> > In some cases the above variableX will have 4+ replaces virutally >> > one >> > after >> > the >> > other with 1 or 2 of the replacement strings having length > 100. >> > >> > This seems like the perfect candidate for StringBuilder.Replace instead > of >> > String.Replace >> > what does anybody think? >> > >> > Regards, >> > Pete >> > >> > >> >> > >
Peter,
Remember that the StringBuilder over allocates its buffer, a string only
ever holds how ever many characters are in it!
The StringBuilder.Capacity property is how many characters the buffer will
hold, while StringBuilder.Length is how many characters are in use. Normally
you should set StringBuilder.Capacity to a value larger then the expected
resultant string. Other wise as Ken stated the StringBuilder will need to
reallocate its buffer. When the StringBuilder reallocates its buffer, it
doubles it in size, which means after a couple reallocates it is probably
significantly larger then it needs to be, by default capacity starts at 16.
By setting the Capacity value when you start (in the constructor for
example) you save the reallocations of the StringBuilder's buffer. You can
use StringBuilder.MaxCapacity to limit to maximum capacity that a
StringBuilder can be expanded to.
For example, I am creating a new StringBuilder that is initialized to my
template "<head><body><tail>", however I am setting the capacity of that
StringBuilder to 1024, which is clearly larger then my three replacement
values. When I use sb.Replace, because the buffer capacity is larger then
the result, the buffer is not reallocated...
Dim sb As New StringBuilder("<head><body><tail>", 1024)
Dim head As New String("h"c, 200)
Dim body As New String("b"c, 200)
Dim tail As New String("t"c, 200)
sb.Replace("<head>", head)
sb.Replace("<body>", body)
sb.Replace("<tail>", tail)
Hope this helps
Jay
"Peter Row" <pe*******@oxfordcc.co.uk> wrote in message
news:es**************@tk2msftngp13.phx.gbl... Hi,
Eh? I don't get what you are saying?
If I have a SBuilder with length 100 and I replace "<head>" (length 6)
with a string that is 200 in length then the Sbuilder has no choice but to resize
surely; because you are replacing 6 out of 100 with 200 hence the length after the replace would be 294 which is 194 larger than before the operation??
Therefore since it is resizing it then you'd assume there is some overhead to that. So how does that overhead compare to doing a : Str = Str.Replace("<head>", str2)
Regards, Peter "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
The stringbuilder will only resize if the string is larger.
Ken --------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:Ow**************@TK2MSFTNGP10.phx.gbl... Hi,
The link provided gives a lot of info but leaves out some important
info hence the original question.
If I have a stringbuilder and lets say it has length = 100, I also
have strHeaderStuff with length = 200. For the sake of argument lets also say that .IndexOf("<head>") is 25
and I say:
MyStrBldr.Replace("<head>", strHeaderStuff)
The stringbuilder object is increasing it's size and inserting at a position it has to find first. So I still need to be convinced that doing it this way will be faster than doing:
SimpleString = SimpleString.Replace("<head>", strHeaderStuff)
I don't wanna start a massive flaming debate about the rights and
wrongs of anything but... wouldn't it of made more sense for MS to implement the String type to
do the same as a StringBuilder under the covers and hence not have StringBuilder?
i.e Dim str As String Str = "Hello" Str &= " World"
Is roughly the same as saying: Dim sbr As New StringBuilder sbr.Append("Hello") sbr.Append(" World")
So if the stringbuilder is so much more efficent why not simply
implement the String that way in the first place?
Regards, Peter
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:OA**************@TK2MSFTNGP12.phx.gbl... > Hi, > > When you use variableX = variableX.Replace("a string",
"another> string") with a string it will it will create a new string in memory and> destroy the old one. The stringbuilder will reuse the memory space > therefore it is quicker. > > http://msdn.microsoft.com/library/de...ilderclass.asp> > Ken > ---------------------- > "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message > news:eV**************@TK2MSFTNGP09.phx.gbl... > > Hi, > > > > I know this has been asked before, but reading the threads it is still not > > entirely clear. > > Deciding which .Replace( ) to use when. > > > > Typically if I create a string in a loop I always use a StringBuilder. At > > present I am > > porting a VB6 webclass app to VB.NET and therefore I am trying to make it > > as > > efficent as possible via the new functionality of VB.NET. > > > > At present I have (in various places): > > variableX = variableX.Replace("a string", "another string") > > > > In some cases the above variableX will have 4+ replaces virutally
one> > after > > the > > other with 1 or 2 of the replacement strings having length > 100. > > > > This seems like the perfect candidate for StringBuilder.Replace instead of > > String.Replace > > what does anybody think? > > > > Regards, > > Pete > > > > > >
Hi,
At last someone that has something worthwhile to say, thanks!
So basically you have to take an educated guess based on your situation and
set the capacity.
I will have to do that as a phase 2 optimisation on my porting from VB6
project as I haven't
been setting the capacity when I use one.
Regards,
Peter
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:ue**************@TK2MSFTNGP10.phx.gbl... Peter, Remember that the StringBuilder over allocates its buffer, a string only ever holds how ever many characters are in it!
The StringBuilder.Capacity property is how many characters the buffer will hold, while StringBuilder.Length is how many characters are in use.
Normally you should set StringBuilder.Capacity to a value larger then the expected resultant string. Other wise as Ken stated the StringBuilder will need to reallocate its buffer. When the StringBuilder reallocates its buffer, it doubles it in size, which means after a couple reallocates it is probably significantly larger then it needs to be, by default capacity starts at
16. By setting the Capacity value when you start (in the constructor for example) you save the reallocations of the StringBuilder's buffer. You
can use StringBuilder.MaxCapacity to limit to maximum capacity that a StringBuilder can be expanded to.
For example, I am creating a new StringBuilder that is initialized to my template "<head><body><tail>", however I am setting the capacity of that StringBuilder to 1024, which is clearly larger then my three replacement values. When I use sb.Replace, because the buffer capacity is larger then the result, the buffer is not reallocated...
Dim sb As New StringBuilder("<head><body><tail>", 1024) Dim head As New String("h"c, 200) Dim body As New String("b"c, 200) Dim tail As New String("t"c, 200)
sb.Replace("<head>", head) sb.Replace("<body>", body) sb.Replace("<tail>", tail)
Hope this helps Jay
"Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:es**************@tk2msftngp13.phx.gbl... Hi,
Eh? I don't get what you are saying?
If I have a SBuilder with length 100 and I replace "<head>" (length 6) with a string that is 200 in length then the Sbuilder has no choice but to resize surely; because you are replacing 6 out of 100 with 200 hence the length after the
replace would be 294 which is 194 larger than before the operation??
Therefore since it is resizing it then you'd assume there is some
overhead to that. So how does that overhead compare to doing a : Str = Str.Replace("<head>", str2)
Regards, Peter "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl... Hi,
The stringbuilder will only resize if the string is larger.
Ken --------------------- "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message news:Ow**************@TK2MSFTNGP10.phx.gbl... > Hi, > > The link provided gives a lot of info but leaves out some important info > hence the original question. > > If I have a stringbuilder and lets say it has length = 100, I also have > strHeaderStuff with length = 200. > For the sake of argument lets also say that .IndexOf("<head>") is 25 and I > say: > > MyStrBldr.Replace("<head>", strHeaderStuff) > > The stringbuilder object is increasing it's size and inserting at a > position > it has to find first. > So I still need to be convinced that doing it this way will be
faster than > doing: > > SimpleString = SimpleString.Replace("<head>", strHeaderStuff) > > I don't wanna start a massive flaming debate about the rights and wrongs > of > anything but... > wouldn't it of made more sense for MS to implement the String type
to do > the > same as a > StringBuilder under the covers and hence not have StringBuilder? > > i.e > Dim str As String > Str = "Hello" > Str &= " World" > > Is roughly the same as saying: > Dim sbr As New StringBuilder > sbr.Append("Hello") > sbr.Append(" World") > > So if the stringbuilder is so much more efficent why not simply implement > the String that way > in the first place? > > Regards, > Peter > > "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message > news:OA**************@TK2MSFTNGP12.phx.gbl... >> Hi, >> >> When you use variableX = variableX.Replace("a string", "another >> string") with a string it will it will create a new string in
memory and >> destroy the old one. The stringbuilder will reuse the memory space >> therefore it is quicker. >> >> > http://msdn.microsoft.com/library/de...ilderclass.asp >> >> Ken >> ---------------------- >> "Peter Row" <pe*******@oxfordcc.co.uk> wrote in message >> news:eV**************@TK2MSFTNGP09.phx.gbl... >> > Hi, >> > >> > I know this has been asked before, but reading the threads it is still > not >> > entirely clear. >> > Deciding which .Replace( ) to use when. >> > >> > Typically if I create a string in a loop I always use a StringBuilder. > At >> > present I am >> > porting a VB6 webclass app to VB.NET and therefore I am trying to make > it >> > as >> > efficent as possible via the new functionality of VB.NET. >> > >> > At present I have (in various places): >> > variableX = variableX.Replace("a string", "another
string") >> > >> > In some cases the above variableX will have 4+ replaces virutally
one >> > after >> > the >> > other with 1 or 2 of the replacement strings having length > 100. >> > >> > This seems like the perfect candidate for StringBuilder.Replace instead > of >> > String.Replace >> > what does anybody think? >> > >> > Regards, >> > Pete >> > >> > >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steve |
last post by:
Hello. I am relatively new to using XML, but I'm trying to convert an xml
document directly to a string or stringbuilder. I'm trying to use the
XmlDocument class and Stringwriter classes, but I am...
|
by: ad |
last post by:
Hello, if I try this
((StringBuilder)sb).Replace("a", "aa");
I get OutOfMemoryException raised if sb contains at least one "a"...
It seems like StringBuilder 'seeker' doesn't move to the end...
|
by: Cor |
last post by:
Hi Newsgroup,
I have given an answer in this newsgroup about a "Replace".
There came an answer on that I did not understand, so I have done some
tests.
I got the idea that someone said,...
|
by: Guy |
last post by:
Hi,
I'm trying to run this code :
strFileContentsHTML.Replace(vbLf, "<br>")
strFileContentsHTML.Replace(vbCrLf, "<br>")
strFileContentsHTML.Replace(vbCr, "<br>")
It doesn't replace newline...
|
by: almurph |
last post by:
Hi everyone,
Can you help me please? Say you have hashtable of about 500 key/value
pairs. This hashtable has to parse a word. If the word matches the key
the then said word must be replaced by...
|
by: Morgan Cheng |
last post by:
In P/Invoke situation, If some *out* parameter is LPWSTR, I can use
string or StringBuilder. However, there is one problem about
StringBuilder. By default, its Capacity is 16. If the returned...
|
by: int main(void) |
last post by:
Hi all,
Following is my attempt to write a string search and replace
function.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>...
|
by: V S Rawat |
last post by:
I was trying to use back-to-back replace functions to convert a url:
str1 =
str.replace("%2F","/").replace("%3F","?").replace("%3D","=").replace("%2
6","&");
It didn't replace all 4 types of...
|
by: bharathreddy |
last post by:
Everyone use the type String in their daily programming more often. In addition, most of people do a common mistake to choose between String and StringBuilder.
In concatenation of Strings,...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
|
by: Oralloy |
last post by:
Hello Folks,
I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA.
My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
|
by: ezappsrUS |
last post by:
Hi,
I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
|
by: jack2019x |
last post by:
hello, Is there code or static lib for hook swapchain present?
I wanna hook dxgi swapchain present for dx11 and dx9.
| |