Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 888
  • 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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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