static void Main(string[] args) { String str = "23"; List <string> results = PhoneWordGenerator.PrintKeywords(str); foreach (string res in results) { Console.Write(res + " "); } }
private void updateDisplay() { this.textBox.Clear(); PhoneWordGenerator phoneWoldGenerator = new PhoneWordGenerator(); try { // get the text from the inputTextBox (inputTextBox.Text) and provide it as the // argument to the following call instead of using the "1234" test string hard-coded below. this.textBox.Text = phoneWoldGenerator.CalculatePossibleWords("1234"); saveButton.Enabled = true; } catch (FormatException) { MessageBox.Show("That is not an integer - please try again"); this.inputTextBox.Select(inputTextBox.TextLength - 1, 1); } catch (OverflowException) { MessageBox.Show("That number is too big to convert - please try again"); this.inputTextBox.Select(inputTextBox.TextLength - 1, 1); } }