You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sharprompt.Example/Program.cs
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ static void Main(string[] args)
54
54
55
55
privatestaticvoidRunInputSample()
56
56
{
57
-
varname=Prompt.Input<string>("What's your name?",defaultValue:"John Smith",placeholder:"At least 3 characters",validators:new[]{Validators.Required(),Validators.MinLength(3)});
57
+
varname=Prompt.Input<string>("What's your name?",defaultValue:"John Smith",placeholder:"At least 3 characters",validators:[Validators.Required(),Validators.MinLength(3)]);
varsecret=Prompt.Password("Type new password",placeholder:"At least 8 characters",validators:new[]{Validators.Required(),Validators.MinLength(8)});
69
+
varsecret=Prompt.Password("Type new password",placeholder:"At least 8 characters",validators:[Validators.Required(),Validators.MinLength(8)]);
70
70
Console.WriteLine($"Password OK, {secret}");
71
71
}
72
72
73
73
privatestaticvoidRunSelectSample()
74
74
{
75
-
varcity=Prompt.Select("Select your city",new[]{"Seattle","London","Tokyo","New York","Singapore","Shanghai"},pageSize:3);
75
+
varcity=Prompt.Select("Select your city",["Seattle","London","Tokyo","New York","Singapore","Shanghai"],pageSize:3);
76
76
Console.WriteLine($"Hello, {city}!");
77
77
}
78
78
79
79
privatestaticvoidRunMultiSelectSample()
80
80
{
81
-
varoptions=Prompt.MultiSelect("Which cities would you like to visit?",new[]{"Seattle","London","Tokyo","New York","Singapore","Shanghai"},pageSize:3,defaultValues:new[]{"Tokyo"});
81
+
varoptions=Prompt.MultiSelect("Which cities would you like to visit?",["Seattle","London","Tokyo","New York","Singapore","Shanghai"],pageSize:3,defaultValues:["Tokyo"]);
0 commit comments