Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void ThrowExceptionIfCurrencyIsNotValid(string currency)
- {
- if (currency.Length != 3)
- {
- throw new ArgumentException(" ", nameof(currency));
- }
- for (int i = 0; i < currency.Length; i++)
- {
- if (!char.IsLetter(currency[i]))
- {
- throw new ArgumentException(" ", nameof(currency));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement