I a looking into somthing that can match my String value.
I have a title in my database as:
BLONDE AND GIRL
What i am trying to do extract the first character of BLONDE
AND GIRL as B
So I can match my url value with B and extract the records
which match this value:
I am using an query like:
SELECT jokes.*, categories.*
FROM
jokes
INNER JOIN categories ON jokes.catID = categories.catID
WHERE
<cfif IsDefined('arguments.title') AND arguments.title
NEQ "">
title LIKE #getNameInitials(arguments.title)#
I am using getNameInitials cflib function but it is not
working:
getNameInitials has this code:
function getNameInitials(str) {
var newstr = "";
var word = "";
var i = 1;
var strlen = listlen(str," ");
for(i=1;i lte strlen;i=i+1) {
word = ListGetAt(str,i," ");
newstr = newstr & UCase(Left(word,1));
}
return newstr;
}
Plz Guide Me
Thanks