diff --git a/lib/xcodeproj/config.rb b/lib/xcodeproj/config.rb
index <HASH>..<HASH> 100644
--- a/lib/xcodeproj/config.rb
+++ b/lib/xcodeproj/config.rb
@@ -81,7 +81,7 @@ module Xcodeproj
     #
     def to_s(prefix = nil)
       include_lines = includes.map { |path| "#include \"#{normalized_xcconfig_path(path)}\"" }
-      settings = to_hash(prefix).sort_by(&:first).map { |k, v| "#{k} = #{v}" }
+      settings = to_hash(prefix).sort_by(&:first).map { |k, v| "#{k} = #{v}".strip }
       [include_lines + settings].join("\n")
     end
[Config] Strip lines when converting to string