String Question

Results 1 to 3 of 3

Thread: String Question

  1. #1
    Join Date
    Dec 1969

    Default String Question

    This may be too simple for you can I only display first three characters of a recorset fieldvalue. <BR><BR>For instance RS("Field1") has the value ABCDE I want to only display ABC and not DE<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969

    Default Left function...

    Response.Write Left( RS("Field1") , 3 )<BR><BR>And, yes, if there are less than 3 characters it does the sensible thing and displays however many there are.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default yep, it's very easy....

    you use the VBScript Left() function.... <BR><BR>say, <BR><BR>var1 = RS("Field1")<BR>var2 = Left(var1, 3) &#039;returns 3 characters counting left-&#062;right<BR><BR>To learn more about the various simple functions, go here:<BR><BR><BR>Vadim C.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts