hey all,
the following snippet works in vb but i'm missing the syntax in csharp:
String val1 = values.Split(",")(1);
i'm getting this error:
Argument '1': cannot convert from 'string' to 'char[]'
thanks,
rodchar 6 2905
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:4D**********************************@microsof t.com...
String val1 = values.Split(",")(1);
string val1 = values.Split(',')[1];
don't c# array subscripts start at zero rather than one in VB?
so, the equivalant would be:
string val1 = values.Split(',')[0];
Jack
Mark Rae wrote:
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:4D**********************************@microsof t.com...
>String val1 = values.Split(",")(1);
string val1 = values.Split(',')[1];
thanks everyone for the great feedback, this has helped. rodchar.
"rodchar" wrote:
hey all,
the following snippet works in vb but i'm missing the syntax in csharp:
String val1 = values.Split(",")(1);
i'm getting this error:
Argument '1': cannot convert from 'string' to 'char[]'
thanks,
rodchar
In both VB and C#, arrays start at 0. The only difference is that in VB you
declare an array size by specifying the upper bound, which is the size less
one.
--
David Anton www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: C#/VB to Python converter
"Jack Hughes" wrote:
don't c# array subscripts start at zero rather than one in VB?
so, the equivalant would be:
string val1 = values.Split(',')[0];
Jack
Mark Rae wrote:
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:4D**********************************@microsof t.com...
String val1 = values.Split(",")(1);
string val1 = values.Split(',')[1];
Try this one,
String val1 = values.Split(",")[1];
Cause we obtain indexed elements value(index) at Visual Basic
but in C# value[index] gives correct result.
rodchar yazdi:
hey all,
the following snippet works in vb but i'm missing the syntax in csharp:
String val1 = values.Split(",")(1);
i'm getting this error:
Argument '1': cannot convert from 'string' to 'char[]'
thanks,
rodchar
No!!!!!!!
It's the "," parameter to the Split method. That is a string but it needs a
char, change it to ','. The single quotes indicates that it is a char
literal instead of a string literal.
string val1 = values.Split(',')[1];
"dursun caglar" <du**********@gmail.comwrote in message
news:11**********************@t69g2000cwt.googlegr oups.com...
Try this one,
String val1 = values.Split(",")[1];
Cause we obtain indexed elements value(index) at Visual Basic
but in C# value[index] gives correct result.
rodchar yazdi:
>hey all, the following snippet works in vb but i'm missing the syntax in csharp:
String val1 = values.Split(",")(1);
i'm getting this error:
Argument '1': cannot convert from 'string' to 'char[]'
thanks, rodchar
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John |
last post by:
Is there an equivalent of COM on Linux that I can get through Python.
My need is to have some sort of language independent component
framework. I can think of CORBA but I have to have a server...
|
by: Michael Foord |
last post by:
Please pardon my ignorance on this one - but I'm not certain how the
sign bt is treated in python bitwise operators. I've trying to convert
a javascript DES encryption routine into python.
...
|
by: Robert Dodier |
last post by:
Hello,
Here's a thought that I'm sure has already occurred to
someone else, I just can't find any record of it yet.
An XML document is just a more verbose and clumsy representation
of an...
|
by: Vannela |
last post by:
Is there any equivalent control in .NET for the Power
builder DataWindow control?
I am explaining the Datawindow architecture to some extent.
Power Builder DataWindow Control has got different...
|
by: Frank Rachel |
last post by:
So I can focus on the correct areas of research, I was wondering if someone
could give me the .NET equivelents for this J2EE architecture:
JSP's make calls to local JavaBean Controls. The...
| |
by: Marty |
last post by:
Hi,
What is the VB.NET equivalent of the VB6 ADODB.Connector and
ADODB.Recordset?
Thanks
Marty
|
by: Tim Conner |
last post by:
Hi,
I am an ex-delphi programmer, and I having a real hard time with the
following simple code (example ):
Which is the equivalent to the following code ?
var
chars : PChar;
sBack, s :...
|
by: karch |
last post by:
How would this C# contruct be represented in C++/CLI? Or is it even
possible?
PolicyLevel level = (enumerator->Current) as PolicyLevel;
Thanks,
Karch
|
by: Alan Silver |
last post by:
Hello,
I'm converting some old VB6 code to use with ASP.NET and have come
unstuck with the Asc() function. This was used in the old VB6 code to
convert a character to its ASCII numeric...
|
by: grid |
last post by:
Hi,
I have a certain situation where a particular piece of code works on a
particular compiler but fails on another proprietary compiler.It seems
to have been fixed but I just want to confirm if...
|
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: 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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |