P0_TrevorGraham/StoreApplication/StoreMain/UI/StoreCLI.cs
/// <summary>
/// Like int.TryParse, this takes a string and converts it into an int, but it will also return false if the string is out of range of the number of options.
/// </summary>
/// <param name="input"></param>
/// <param name="numOptions"></param>
/// <param name="output"></param>
/// <returns></returns>
Like int.TryParse, this takes a string and converts it into an int, but it will also return false if the string is out of range of the number of options.
Like int . TryParse this takes a string and converts it into an int but it will also return false if the string is out of range of the number of options .
private bool IsValidNumberOption(string input, int numOptions, out int output){
            bool validOption = false;
            validOption = int.TryParse(input,out output);
            if(validOption && output>=0 && output<numOptions){
                validOption = true;
            }
            else{
                validOption =false;
                }
            return validOption;
        }
private bool IsValidNumberOption ( string input , int numOptions , out int output ) { bool validOption = false ; validOption = int . TryParse ( input , out output ) ; if ( validOption && output >= 0 && output < numOptions ) { validOption = true ; } else { validOption = false ; } return validOption ; }
Like int.TryParse, this takes a string and converts it into an int, but it will also return false if the string is out of range of the number of options.
Like int . TryParse this takes a string and converts it into an int but it will also return false if the string is out of range of the number of options .
None
input
string
None
numOptions
int
None
int
out
output
None