Asp Substring

Discussion in 'C#' started by rambala, Jun 26, 2008.

  1. #1
    Hi,

    i want to use substring function in my ASP page , please tell me what is the right syntax, following is the my code, but i am facing a error, please check this code.

    <%
    Dim strVar
    Dim strVar1
    strVar="saqib"
    strVar1=substring(strVar,1,3)
    response.write strVar1
    %>

    Thanks,
    Bye.
     
    rambala, Jun 26, 2008 IP
  2. wowla_123

    wowla_123 Peon

    Messages:
    147
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In this case, use Left function:

    <%
    Dim strVar
    Dim strVar1
    strVar="saqib"
    strVar1=Left(strVar,3)
    response.write strVar1
    %>
    Code (markup):
    It will display saq.

    See examples of Left(), Right() and Mid() functions.
     
    wowla_123, Jun 26, 2008 IP