The Empty String | Issunのブログ

Issunのブログ

Localization, VBA, and C#

When creating an empty string, or setting a string to be empty, the usual way is:

text = ""

But you are spending 6 bytes of memory just to say it's empty. Instead use:

text = vbNullString

It's faster and takes less memory. This small optimization may not add up to huge savings thanks to the power of today's PCs but savings do add up and it's good to know that an empty string is still a string.


iPhoneからの投稿