text input limit the number of lines code example Example: getline limit input string text; getline(cin, text); text = text.substr(0, 100);