private IQueryable <LibraryItem> GetTitleAndTitleAcronym(IQueryable <LibraryItem> libraryItems) { string Convert(IEnumerable <char> s) => new string(s.ToArray()); foreach (LibraryItem Titles in libraryItems) { string AcronymedTitel = Convert(Titles.Title.Where((c, i) => !char.IsWhiteSpace(c) && (i == 0 || char.IsWhiteSpace(Titles.Title[i - 1])))); Titles.SetAcronymedTitle(Titles.Title, AcronymedTitel.ToUpper()); } return(libraryItems); }