Data work.my_data_file; Result_1 = Anydigit('A string with 1 digit'); Result_2 = Anydigit('1 string with 2 digits'); Result_3 = Anydigit('What about non integers? .01'); Run; |
What's happening in the script above?
Variable | Input | Output | Description |
---|---|---|---|
Result_1 | A string with 1 digit | 15 | Returns the position count of the number 1 |
Result_2 | 1 string with 2 digits | 1 | Also returns the position count of the number 1 |
Result_3 | What about non integers? .01 | 27 | Returns the position count of the 0 between . and 1 |
See also; Notdigit Function
Kevin Regan
Have an article, idea, found a typo, want to contribute? Shoot me an email
Here
Below are links to some Udemy Data Science Courses. I've been using Udemy for a number of years now, and I've found their courses super helpful, maybe you will also.