473,385 Members | 1,944 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,385 software developers and data experts.

StrDup

Hello there-

Someone knows a page or document with a cross reference between VB.NET and
C#?

--For example. I cannot find easily an equivalence of the funcion StrDup of
VB.NET in C#

May 30 '06 #1
2 5576
Harvey,

You can do this easily with the string constructor. There is an
overload that takes a character and the number of times to duplicate it and
creates a new string.

If you have a need for the exact logic (where you can pass non-strings,
or strings with more than one character, and it takes the first character),
then you can always set a refrence to Microsoft.VisualBasic.dll, and then
use the static StrDup function on the Strings class in the
Microsoft.VisualBasic namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"<Harvey Triana />" <ha**********@hotmail.com> wrote in message
news:eG**************@TK2MSFTNGP05.phx.gbl...
Hello there-

Someone knows a page or document with a cross reference between VB.NET and
C#?

--For example. I cannot find easily an equivalence of the funcion StrDup
of VB.NET in C#

May 30 '06 #2
Thank you
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> escribió
en el mensaje news:%2******************@TK2MSFTNGP02.phx.gbl...
Harvey,

You can do this easily with the string constructor. There is an
overload that takes a character and the number of times to duplicate it
and creates a new string.

If you have a need for the exact logic (where you can pass non-strings,
or strings with more than one character, and it takes the first
character), then you can always set a refrence to
Microsoft.VisualBasic.dll, and then use the static StrDup function on the
Strings class in the Microsoft.VisualBasic namespace.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"<Harvey Triana />" <ha**********@hotmail.com> wrote in message
news:eG**************@TK2MSFTNGP05.phx.gbl...
Hello there-

Someone knows a page or document with a cross reference between VB.NET
and C#?

--For example. I cannot find easily an equivalence of the funcion StrDup
of VB.NET in C#


May 30 '06 #3

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

Similar topics

39
by: Allan Bruce | last post by:
Hi there, I have a program written in c++ and I wish to use a similar function to strdup(). The reason I have problems is that the char array requires freeing to avoid a memory leak, but I get...
6
by: Stefan Schwärzler | last post by:
Hi Ng, habe nicht besonders viel Erfahrung in C und C++, deshalb: möchte den befehl strdup in <string.h> verwenden. #include <string.h> attrib(char *name, char *val) : name(strdup(name)),...
32
by: Grumble | last post by:
As far as I can tell, strdup() is neither in C89 nor in C99. Is that correct? <OT>Is it in POSIX perhaps?</OT>
37
by: priya | last post by:
Hi all, I am using strdup() in my c program..But I am having some pr0blem while using the free() in my c code.here I am pasting the my code. #include <stdio.h>
53
by: klaushuotari | last post by:
Sorry to bother you, but I just have to. What about strdup()? It wasn't in standard C run-time library, yet many apps use it liberally as it was in there. I don't know if that particular...
20
by: Michael Holm | last post by:
Ever so often when I try to compile some open source code, I get a error, pbrtparse.y(205) : error C3861: 'strdup': identifier not found In the example, I'm trying to compile pbrt...
5
by: lovecreatesbea... | last post by:
I am trying the FREE net-snmp library things. Like the FREE libxml++ library, it lacks of a reasonable document on its API. Its very begining example code compiles and runs. It says "blah blah .."...
10
by: thomas | last post by:
Hi, It's known that strdup() returns a char* type, but sometimes the following code generates warning messages. char *x = ... char *p = strdup(x); You must change it to
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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,...

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.