Skip to content

Commit

Permalink
impl split keyword xforeach
Browse files Browse the repository at this point in the history
  • Loading branch information
nameofSEOKWONHONG committed May 29, 2021
1 parent 03442f0 commit 234252d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/XCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ public static T xReaderToObject<T>(this IDataReader reader)

#endregion [Datatable & DataReader]

public static void xForEach(this IEnumerable<string> itorator, string split, Action<string, string> action) {
itorator.xForEach((item, i) => {
if (itorator.Count() - 1 == i) split = "";
action(item, split);
});
}

public static void xForeach(this ValueTuple<int, int> fromTo, Action<int> action) {
for (var i = fromTo.Item1; i <= fromTo.Item2; i++) {
action(i);
Expand Down

0 comments on commit 234252d

Please sign in to comment.