Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 931
  • Last Modified:

Crystal Reports XI: Search for and count occurrence(s) of a specific character in a string field?

Is there a way that I can search a string field for a specific character and then count the amount of occurrences for that character? Basically, I need a true/false test as to  whether or not a string contains two ampersands.

I've played around with some different string functions but I can't quite seem to dial it in.


Thank you
0
QTony
Asked:
QTony
  • 2
1 Solution
 
OCDanCommented:
If {table.field} like '*&*&*'
then 1
else 0

That should do the trick
0
 
QTonyAuthor Commented:
I don't why I didn't see the obvious---Thanks
0
 
OCDanCommented:
We have all been there mate
0
 
mlmccCommented:
Good solution.

Another would be UBound(Split({YourField},'&')) >= 3

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now