aspx thread: Left and Right
Message #1 by "icaaq" <isac@m...> on Mon, 11 Nov 2002 19:09:16 +0100
|
|
Hi.
How can i make a funktion that replicates Left() and Right() in VBScript and
that in C#
many thanx icaaq
Message #2 by "Paul Riley" <rilez@t...> on Mon, 11 Nov 2002 18:38:57 -0000
|
|
Left and right are replaced by classes of the string data type depending
on what you actually want to do with left and right. Look into Endswith
and startswith for comparison logic. To actually "cut" the string (eg
make "pleh" become "pl") I think you'd have to use substring although
there may be an easier way.
On word "random" for example
Endswith("om") = true
Startswith("ran") = true
Substring(0,2) = "ran"
Hope that helps
-----Original Message-----
From: icaaq [mailto:isac@m...]
Sent: 11 November 2002 18:09
To: ASP.NET
Subject: [aspx] Left and Right
Hi.
How can i make a funktion that replicates Left() and Right() in VBScript
and
that in C#
many thanx icaaq
Message #3 by "icaaq" <isac@m...> on Mon, 11 Nov 2002 19:45:03 +0100
|
|
But if i want to have
"dom" from random.....how can i do that?
"Paul Riley" <rilez@t...> skrev i meddelandet news:233754@a...
>
> Left and right are replaced by classes of the string data type depending
> on what you actually want to do with left and right. Look into Endswith
> and startswith for comparison logic. To actually "cut" the string (eg
> make "pleh" become "pl") I think you'd have to use substring although
> there may be an easier way.
> On word "random" for example
> Endswith("om") = true
> Startswith("ran") = true
> Substring(0,2) = "ran"
>
> Hope that helps
>
> -----Original Message-----
> From: icaaq [mailto:isac@m...]
> Sent: 11 November 2002 18:09
> To: ASP.NET
> Subject: [aspx] Left and Right
>
> Hi.
> How can i make a funktion that replicates Left() and Right() in VBScript
> and
> that in C#
>
> many thanx icaaq
>
>
>
>
>
>
Message #4 by "Paul Riley" <rilez@t...> on Mon, 11 Nov 2002 18:59:59 -0000
|
|
Use the string.length to get the total length of the string and then
subtract the number of characters - like I said there's probably an
easier way of doing it but I've not found it
-----Original Message-----
From: icaaq [mailto:isac@m...]
Sent: 11 November 2002 18:45
To: ASP.NET
Subject: [aspx] Re: Left and Right
But if i want to have
"dom" from random.....how can i do that?
"Paul Riley" <rilez@t...> skrev i meddelandet
news:233754@a...
>
> Left and right are replaced by classes of the string data type
depending
> on what you actually want to do with left and right. Look into
Endswith
> and startswith for comparison logic. To actually "cut" the string (eg
> make "pleh" become "pl") I think you'd have to use substring although
> there may be an easier way.
> On word "random" for example
> Endswith("om") = true
> Startswith("ran") = true
> Substring(0,2) = "ran"
>
> Hope that helps
>
> -----Original Message-----
> From: icaaq [mailto:isac@m...]
> Sent: 11 November 2002 18:09
> To: ASP.NET
> Subject: [aspx] Left and Right
>
> Hi.
> How can i make a funktion that replicates Left() and Right() in
VBScript
> and
> that in C#
>
> many thanx icaaq
>
>
>
>
>
>
|