/// <summary> /// Перечень подполей с указанным кодом. /// </summary> /// <param name="code">Искомый код подполя.</param> /// <remarks>Сравнение кодов происходит без учета /// регистра символов.</remarks> /// <returns>Найденные подполя.</returns> public SubField[] GetSubField ( char code ) { SubField[] result = SubFields .Where(_ => _.Code.SameChar(code)) .ToArray(); return(result); }
/// <summary> /// Replaces the sub field. /// </summary> /// <param name="code">The code.</param> /// <param name="oldValue">The old value.</param> /// <param name="newValue">The new value.</param> /// <returns>RecordField.</returns> public RecordField ReplaceSubField ( char code, string oldValue, string newValue ) { var found = SubFields .Where(sf => sf.Code.SameChar(code) && (string.CompareOrdinal(sf.Text, oldValue) == 0)); foreach (SubField subField in found) { subField.Text = newValue; } return(this); }