It's up to you to define the rules for your app.

For instance, you may define that:


Whitespace before or after the equality sign is ignored,
Whitespace inside the key is forbidden,
Whitespace inside the value can be used only if the value is enclosed in quotes, so:

say-hello = Hello, World!


is forbidden, while:

say-hello = "Hello, World!"


is allowed, which also makes it possible to have whitespace prefixes:

say-hello = "    Indentation is sweet."



Defining a format may be a complex task. For instance:


How do you escape quotes?
How do you escape the escape character you use to escape quotes?
How do you handle empty values?
What is the maximum length of a key? What about a value?
How do you handle multiline values?
What about whitespace Unicode characters other than a space (such as a non-breaking space character)?
What about Unicode characters which are usually not displayed on the screen? For instance, how do you deal with Unicode categories Cf or Zl?
What are the characters allowed in the key? For example, is:

'


a valid key?
Should the following line work?¹

say-hello ꘌ "Hello, World!"


Hint: the equality sign is not an equality sign, but the character 0xa60c (Vai syllable lengthener). Although few people would use this symbol instead of the equality, the more frequent case is a copy-paste from Microsoft Word (watch closely the quotation marks):

say-hello = “Hello, World!”

etc.


This is why, unless you are completely sure that you can define a format and describe it precisely and verbosely, use a format which already exists.

JSON or XML are commonly used formats you can use in nearly every programming language. You may even abstract the underlying format by using a database. Redis, for instance, is a popular solution for key-value store.



¹ Chrome users using Windows would probably see a question mark in a square. With other browsers or with Chrome on Linux, the character appears like an equality sign and can easily be misleading: the only visual difference is that there is a tiny difference in the space between the horizontal bars.

What is best practice to handle whitespaces when letting the user edit the configuration, the name=value pairs?
Which is the best introductory textbook for Bayesian statistics?

One book per answer, please.
