Hi Folks! While doing substring search I am facin...
# cfml-general
u
Hi Folks! While doing substring search I am facing issue when substring contains or keyword in it then it return false result Any work around for it?
👀 1
d
I must not understand what you're doing or expecting. Are you really looking for "multiple emergency department visits..." in whatever the value is in getStartofCare.F143)? Seems unlikely. The test I did with the word "or" in the string being searched for returns 0 as expected.
u
I am doing <cfdump var='#findNoCase('Multiple hospitalizations (2 or more) in the past 6 months', '3. Multiple hospitalizations (2 or more) in the past 6 months!6. Reported or observed history of difficulty complying with any medical instructions (for example, medications, diet, exercise) in the past 3 months',0)#'>
It is returning 4 as result on https://cfdocs.org/findnocase but trying on my development server giving 0 as result
c
Because this substring
Multiple hospitalizations (2 or more) in the past 6 months
is found, and it starts at the 4th character of the string it's looking in, so it's true with 4 returned, as expected.
u
yes but in my server it is returning 0 when value is usedas variable
c
Copy code
<cfset variables.sentence = "3. Multiple hospitalizations (2 or more) in the past 8 months!6. Reported or observed history of difficulty complying with any medical instructions (for example, medications, diet, exercise) in the past 3 months">

<cfdump var='#findNoCase('Multiple hospitalizations (2 or more) in the past 6 months', #variables.sentence#,0)#'>
I see. Strange.
Oops sorry, I had changed the text while messing with it.
Now I get the expected result
Copy code
<cfset variables.sentence = "3. Multiple hospitalizations (2 or more) in the past 6 months!6. Reported or observed history of difficulty complying with any medical instructions (for example, medications, diet, exercise) in the past 3 months">

<cfdump var='#findNoCase('Multiple hospitalizations (2 or more) in the past 6 months', #variables.sentence#,0)#'>
Returns 4
u
when I did execute your above code then it throws me he eror
u
message has been deleted
u
I got the issue now the main string should be wrap with in quotes 😛
👍 1
very strange thing happening again when I do find with query column name then nothing found But If I declare the static variable which you did then it work smoothly
Both are same but showing different results
The below result NO NO should also be YES YES