How do I check if a string contains any numeric value.
Ex: paul123
The above example contains numeric value so I should get the output as true.
How do I check if a string contains any numeric value.
Ex: paul123
The above example contains numeric value so I should get the output as true.
Use a regular expression match:
'paul123' -match '\d'
\d
matches a digit (0-9), so the expression will evaluate to true if the string contains at least one digit.
© 2022 - 2024 — McMap. All rights reserved.