Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: string manipulation using vb


Message #1 by jmnamahoe@h... on Mon, 3 Jun 2002 20:54:09
i want to extract certain parts of a string, but when i use the left(), 
right(), or mid() i receive an error. for example if i was to use the 
left() function, an error is returned advising that 'left' is not defined. 
is there a namespace dedicated to the manipulation of strings that needs 
to be imported in a codebehind in order to run the left() function or do 
you have to right your own function. thanx.
Message #2 by "Curtner, Lynn" <lynn.curtner@p...> on Mon, 3 Jun 2002 14:50:34 -0500
Hard to tell because the entire body of your post is in lower case, but did you perhaps use left()
instead of Left()?  

> ----------
> From: 	jmnamahoe@h...[SMTP:jmnamahoe@h...]
> Reply To: 	aspx_beginners
> Sent: 	Monday, June 03, 2002 3:54 PM
> To: 	aspx_beginners
> Subject: 	[aspx_beginners] string manipulation using vb
> 
> i want to extract certain parts of a string, but when i use the left(), 
> right(), or mid() i receive an error. for example if i was to use the 
> left() function, an error is returned advising that 'left' is not defined. 
> is there a namespace dedicated to the manipulation of strings that needs 
> to be imported in a codebehind in order to run the left() function or do 
> you have to right your own function. thanx.
> 
Message #3 by "Michael Spiering" <mspier@n...> on Mon, 3 Jun 2002 14:59:11 -0500
Here is a quote from Pro VB.NET that seems to apply:

"Although not documented as removed, the Left, Right, and Mid functions are
at least deprecated in VB.NET.  This is largely due to the fact that the
.NET String class has a method called SubString."

You could probably still find the Left, Right, and Mid in the VB6 namespace,
but I would use SubString.

-----Original Message-----
From: Curtner, Lynn [mailto:lynn.curtner@p...]
Sent: Monday, June 03, 2002 1:51 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: string manipulation using vb


Hard to tell because the entire body of your post is in lower case, but did
you perhaps use left() instead of Left()?

> ----------
> From: 	jmnamahoe@h...[SMTP:jmnamahoe@h...]
> Reply To: 	aspx_beginners
> Sent: 	Monday, June 03, 2002 3:54 PM
> To: 	aspx_beginners
> Subject: 	[aspx_beginners] string manipulation using vb
>
> i want to extract certain parts of a string, but when i use the left(),
> right(), or mid() i receive an error. for example if i was to use the
> left() function, an error is returned advising that 'left' is not defined.
> is there a namespace dedicated to the manipulation of strings that needs
> to be imported in a codebehind in order to run the left() function or do
> you have to right your own function. thanx.
>




Message #4 by "Curtner, Lynn" <lynn.curtner@p...> on Mon, 3 Jun 2002 15:00:24 -0500
Oh, sorry.  Use Substring()...

> ----------
> From: 	Curtner, Lynn[SMTP:lynn.curtner@p...]
> Reply To: 	aspx_beginners
> Sent: 	Monday, June 03, 2002 2:50 PM
> To: 	aspx_beginners
> Subject: 	[aspx_beginners] RE: string manipulation using vb
> 
> Hard to tell because the entire body of your post is in lower case, but did you perhaps use left() instead of Left()?  
> 
> > ----------
> > From: 	jmnamahoe@h...[SMTP:jmnamahoe@h...]
> > Reply To: 	aspx_beginners
> > Sent: 	Monday, June 03, 2002 3:54 PM
> > To: 	aspx_beginners
> > Subject: 	[aspx_beginners] string manipulation using vb
> > 
> > i want to extract certain parts of a string, but when i use the left(), 
> > right(), or mid() i receive an error. for example if i was to use the 
> > left() function, an error is returned advising that 'left' is not defined. 
> > is there a namespace dedicated to the manipulation of strings that needs 
> > to be imported in a codebehind in order to run the left() function or do 
> > you have to right your own function. thanx.
> > 
> 
> 
Message #5 by jmnamahoe@h... on Tue, 4 Jun 2002 01:52:00
if you use substring() to manipulate a string, what do you use to 
manipulate a date. if you wanted to extract just the year and month of a 
date, what function would you use. in vb i know you can use the format(), 
but i'm not sure on how to manipulate the date using vb.net or asp.net

> Here is a quote from Pro VB.NET that seems to apply:

"Although not documented as removed, the Left, Right, and Mid functions are
at least deprecated in VB.NET.  This is largely due to the fact that the
.NET String class has a method called SubString."

You could probably still find the Left, Right, and Mid in the VB6 
namespace,
but I would use SubString.

-----Original Message-----
From: Curtner, Lynn [mailto:lynn.curtner@p...]
Sent: Monday, June 03, 2002 1:51 PM
To: aspx_beginners
Subject: [aspx_beginners] RE: string manipulation using vb


Hard to tell because the entire body of your post is in lower case, but did
you perhaps use left() instead of Left()?

> ----------
> From: 	jmnamahoe@h...[SMTP:jmnamahoe@h...]
> Reply To: 	aspx_beginners
> Sent: 	Monday, June 03, 2002 3:54 PM
> To: 	aspx_beginners
> Subject: 	[aspx_beginners] string manipulation using vb
>
> i want to extract certain parts of a string, but when i use the left(),
> right(), or mid() i receive an error. for example if i was to use the
> left() function, an error is returned advising that 'left' is not 
defined.
> is there a namespace dedicated to the manipulation of strings that needs
> to be imported in a codebehind in order to run the left() function or do
> you have to right your own function. thanx.
>




Message #6 by "Michael Spiering" <mspier@n...> on Mon, 3 Jun 2002 21:06:02 -0500
Well, the format function is still around. Format(Now(), "y") returns "June,
2002".  Also, the ToString() method is overridden for DateTime objects to
accept the format strings you are used to as well.  So Now().ToString("y")
also returns "June, 2002" (which I think is kind of cool).

If you are talking about the DatePart() or DateAdd() functions, again, they
are still around in VB, but they are also covered by properties and methods
of the DateTime class, e.g., Now().Month or myDate.AddMonth(2).

There is also System.DateTime.Parse() for converting a string to a DateTime.

-----Original Message-----
From: jmnamahoe@h... [mailto:jmnamahoe@h...]
Sent: Tuesday, June 04, 2002 12:52 AM
To: aspx_beginners
Subject: [aspx_beginners] RE: string manipulation using vb


if you use substring() to manipulate a string, what do you use to
manipulate a date. if you wanted to extract just the year and month of a
date, what function would you use. in vb i know you can use the format(),
but i'm not sure on how to manipulate the date using vb.net or asp.net

> Here is a quote from Pro VB.NET that seems to apply:

"Although not documented as removed, the Left, Right, and Mid functions are
at least deprecated in VB.NET.  This is largely due to the fact that the
.NET String class has a method called SubString."

You could probably still find the Left, Right, and Mid in the VB6
namespace,
but I would use SubString.






  Return to Index