LPCSTR- How to check if first Position is a Space " "

144 views Asked by At

Simple Question.

How to check what char is on first Position on a LPCSTR?

Or just check if there is a Space on first Position?

1

There are 1 answers

1
cdhowie On BEST ANSWER

Given an LPCSTR named str, you can access the first character using str[0]. For example:

if (str[0] == ' ') {
    // First character is a space
}