Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16210

How to check if a string contains only specific characters

$
0
0

I need to check a string to determine if it contains any characters other than |, in order to assign those variables that have nothing except | a value of NULL (there could be theoretically any number of | characters but it likely will not be more than 5-6). Like ||||

I could see looping through each character of the string or somesuch, but I feel there must be a simpler way.


Viewing all articles
Browse latest Browse all 16210

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>