|
 |
asp_databases thread: String Conversion
Message #1 by "donohue ian" <ianmdonohue@c...> on Fri, 29 Nov 2002 00:31:18 -0000
|
|
Help please with string conversion. I have read a number of books and
the following conversion appears to be impossible. I hope I am wrong
Conversion from P\02\1234\FP to P_02_1234
The variable would then be used within a hyperlink to access information
Thanks
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 29 Nov 2002 12:44:03 +1100
|
|
Use Replace() to turn \ into _
Use InStrRev() to find the occurance of the last _
Use Left() to take everything to the left of the last _
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "donohue ian" <ianmdonohue@c...>
Subject: [asp_databases] String Conversion
: Help please with string conversion. I have read a number of books and
: the following conversion appears to be impossible. I hope I am wrong
:
: Conversion from P\02\1234\FP to P_02_1234
:
: The variable would then be used within a hyperlink to access information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by "Carl E. Olsen" <carl-olsen@m...> on Thu, 28 Nov 2002 20:07:08 -0600
|
|
<%@ Language=VBScript %>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
strStart = "P\02\1234\FP"
Response.Write strStart & "<BR>"
strFind = "\"
intSplit = InStrRev(strStart, strFind)
Response.Write intSplit & "<BR>"
strSplit = left(strStart, intSplit-1)
Response.Write strSplit & "<BR>"
strResult = Replace(strSplit, "\", "_")
Response.Write strResult
%>
</BODY>
</HTML>
> -----Original Message-----
> From: donohue ian [mailto:ianmdonohue@c...]
> Sent: Thursday, November 28, 2002 6:31 PM
> To: ASP Databases
> Subject: [asp_databases] String Conversion
>
>
>
> Help please with string conversion. I have read a number of books and
> the following conversion appears to be impossible. I hope I am wrong
>
> Conversion from P\02\1234\FP to P_02_1234
>
> The variable would then be used within a hyperlink to access
information
>
>
> Thanks
>
>
> to unsubscribe send a blank email to leave-asp_databases-
> 1112136X@p...
Message #4 by "selva kumar" <seldanny@h...> on Fri, 29 Nov 2002 15:51:56 +0530
|
|
there is a function called replace , that help in converting from a specific
values. check that out
>From: "Carl E. Olsen" <carl-olsen@m...>
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] RE: String Conversion
>Date: Thu, 28 Nov 2002 20:07:08 -0600
>
><%@ Language=VBScript %>
><HTML>
><HEAD>
></HEAD>
><BODY>
><%
>
>strStart = "P\02\1234\FP"
>
>Response.Write strStart & "<BR>"
>
>strFind = "\"
>
>intSplit = InStrRev(strStart, strFind)
>
>Response.Write intSplit & "<BR>"
>
>strSplit = left(strStart, intSplit-1)
>
>Response.Write strSplit & "<BR>"
>
>strResult = Replace(strSplit, "\", "_")
>
>Response.Write strResult
>
>%>
>
></BODY>
></HTML>
> > -----Original Message-----
> > From: donohue ian [mailto:ianmdonohue@c...]
> > Sent: Thursday, November 28, 2002 6:31 PM
> > To: ASP Databases
> > Subject: [asp_databases] String Conversion
> >
> >
> >
> > Help please with string conversion. I have read a number of books and
> > the following conversion appears to be impossible. I hope I am wrong
> >
> > Conversion from P\02\1234\FP to P_02_1234
> >
> > The variable would then be used within a hyperlink to access
>information
> >
> >
> > Thanks
> >
> >
> > to unsubscribe send a blank email to leave-asp_databases-
> > 1112136X@p...
>
>
>
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
|
|
 |