Results 1 to 3 of 3


  1. #1
    J. Harper Guest


    I need to determine the first letter of the value of a variable. I am writing a script for an eCommerce site, and below the product name, I am trying to put the manufacturer, so it looks like:<BR><BR>Windows ME<BR>A Microsoft Product<BR><BR>Except if the product I was displaying was, for instance made by Inktomi, "A Inktomi Product" wouldn&#039;t be correct English. I would need to display "An Inktomi Product". So here&#039;s what I need to do:<BR><BR>1. Determine if a variable&#039;s first letter is a vowel<BR><BR>It should be noted that I have the display string set up like:<BR>Response.Write("A " & pManufacturer & " Product")<BR><BR>2. If it starts with a vowel, display "An", otherwise display "A".<BR><BR>I can do step two but I need to know how I can find the first letter of pManufacturer. Thanks!<BR><BR>P.S. Please send answers to as I will be checking my mail more often than this message board. Thanks again!

  2. #2
    Richard A. Lowe Guest

    Default RE:

    Nope, sorry, I&#039;m answering here... hope you check soon.<BR><BR>Left(pManufacturer, 1) should do it.

  3. #3
    Mike Shaffer Guest

    Default RE:

    Hi j.,<BR><BR>One of the reasons that we like to post answers here rather than directly to your email is so that EVERYBODY can learn. It&#039;s the basic purpose of a forum. ;-)<BR><BR>Anyway, you could do something like this:<BR><BR>===================<BR>if instr("AEIOUY", left(pManufacturer, 1))&#062;0 then<BR>&nbsp;&nbsp;&nbsp; response.write "An "<BR>else<BR>&nbsp;&nbsp;&nbsp; response.write "A "<BR>end if<BR>response.write pManufacturer & " Product"<BR>===================<BR><BR>Hope this helps!<BR>

Posting Permissions

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