/// <summary> /// Write the elements for this field to the XML /// </summary> /// <param name="writer"></param> internal override void WriteExtraElements(XmlHelper writer) { writer.WriteElement("FieldQuoted", FieldQuoted); writer.WriteElement("QuoteChar", QuoteChar.ToString(), "\""); writer.WriteElement("QuoteMode", QuoteMode.ToString(), "OptionalForRead"); writer.WriteElement("QuoteMultiline", QuoteMultiline.ToString(), "AllowForRead"); }
private string QuoteValue(string Value) { if (Value.IndexOf(QuoteChar) > -1) { StringBuilder sb = new StringBuilder(); sb.Append(QuoteChar); sb.Append(QuoteChar); Value = Value.ToString().Replace(QuoteChar.ToString(), sb.ToString()); } return(QuoteChar + Value + QuoteChar); }
private string QuoteValue(string value) { if (value.IndexOf(QuoteChar) > -1) { StringBuilder sb = new StringBuilder(); sb.Append(QuoteChar); sb.Append(QuoteChar); value = value.ToString().Replace(QuoteChar.ToString(), sb.ToString()); } return(QuoteWrap ? $"{QuoteChar}{value}{QuoteChar}" : value); }