diff --git a/source/OFXSharp/OFXDocumentParser.cs b/source/OFXSharp/OFXDocumentParser.cs index d8071ef..2a7bf7c 100644 --- a/source/OFXSharp/OFXDocumentParser.cs +++ b/source/OFXSharp/OFXDocumentParser.cs @@ -46,7 +46,10 @@ private OFXDocument Parse(string ofxString) if (currencyNode != null) { ofx.Currency = currencyNode.FirstChild.Value; - } + if (OFXHelperMethods.TrimValues) + ofx.Currency = ofx.Currency.Trim(); + + } else { throw new OFXParseException("Currency not found"); diff --git a/source/OFXSharp/OFXHelperMethods.cs b/source/OFXSharp/OFXHelperMethods.cs index 5be4662..944bd3e 100644 --- a/source/OFXSharp/OFXHelperMethods.cs +++ b/source/OFXSharp/OFXHelperMethods.cs @@ -61,9 +61,13 @@ public static string GetValue(this XmlNode node, string xpath) if (tempNode != null && tempNode.FirstChild != null) { - return tempNode.FirstChild.Value; + var ret = tempNode.FirstChild.Value; + if (TrimValues) + return ret?.Trim(); + return ret; } return String.Empty; } + public static bool TrimValues; } } \ No newline at end of file