Ask Your Question
1

Can the batch set init function be configured to differentiate between upper and lower case letters?

asked 2023-05-27 15:29:35 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-27 15:42:02 +0000

pufferfish gravatar image

Yes, the batch set init function can be configured to differentiate between upper and lower case letters using the "if" statement and the "==" operator. For example:

set initial=a
if "%initial%"=="A" (
   echo The initial is uppercase
) else (
   echo The initial is lowercase
)

In this example, the script sets the variable "initial" to "a" and checks whether it is equal to "A" using the "if" statement and the "==" operator. If it is equal, the script echoes "The initial is uppercase". If it is not equal, the script echoes "The initial is lowercase".

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-27 15:29:35 +0000

Seen: 8 times

Last updated: May 27 '23