February 2019
Intermediate to advanced
626 pages
15h 51m
English
A switch statement uses the following generalized notation:
switch [-regex|-wildcard][-casesensitive] (<value>) {
<condition> { <statements> }
<condition> { <statements> }
}
The casesensitive parameter applies when testing conditions against a string value.
The switch command can also be used to work on the content of a file using the following notation:
switch [-regex|-wildcard][-casesensitive] -File <Name> {
<condition> { <statements> }
<condition> { <statements> }
}
The File parameter can be used to select from a text file (line by line). The switch statement differs from conditions written using if-elseif in one important respect. The switch statement will not stop testing conditions unless the break keyword is used, for example: ...
Read now
Unlock full access