Sharprompt icon indicating copy to clipboard operation
Sharprompt copied to clipboard

How to reset the default value to an empty string

Open dinodipardo opened this issue 11 months ago • 7 comments

How can you reset the default value to an empty string in the following situation?

stringInputPrompt = "I'm the default value";

stringInputPrompt = Prompt.Input( $"Please provide a value or press enter to use the default value", defaultValue: string.IsNullOrEmpty(stringInputPrompt) ? null : stringInputPrompt, validators: null );

The goal is to prepopulate the value, so the user doesn't have to re-enter it each time (similar to a setup wizard).

dinodipardo avatar Feb 06 '25 18:02 dinodipardo