1 Replies - 410 Views - Last Post: 02 September 2018 - 02:16 PM Rate Topic: -----

#1 mossman72   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 30-August 18

cfif question

Posted 30 August 2018 - 07:49 AM

Good Morning and thank you for having me!

Is there a way in CF to check to see if the first character in a string contains a letter and if so to split the results of the query?

Best,
Aaron
Is This A Good Question/Topic? 0
  • +

Replies To: cfif question

#2 Craig328   User is offline

  • I make this look good
  • member icon

Reputation: 2041
  • View blog
  • Posts: 3,642
  • Joined: 13-January 08

Re: cfif question

Posted 02 September 2018 - 02:16 PM

Hi Aaron/mossman72 and welcome to DIC!

You've posted a question I can address and one I cannot (without further details).

To address "a way in CF to check to see if the first character in a string contains a letter" you would use the CF function called MID (or you could use the LEFT function as well), get the value for the first character and then compare it to a string of alphabet characters and see if it's found in that string. If it is, then the first character in your string is a letter. There is a quicker and more advanced way of doing this by using a regular expression but it sounds like you're a beginner and, even for dev experts, regular expressions can be a confusing pain in the ass.

Your second question (if so to split the results of the query) is way too vague to properly address. If you can rephrase here what you're looking for, perhaps we can help.

Good luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1