Giter Club home page Giter Club logo

extensions's People

Contributors

keith-hall avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

extensions's Issues

Add tests for StringExtensions to show how they work, example uses etc.

Add tests for StringExtensions to show how they work, example uses etc.
Could base on the following LINQPad dumps:

"hello world".IndexOfEnd("hello").Dump("IndexOfEnd hello");
"hello world".AllSortedIndexesOf(new [] { "o", "e", "l"}).Dump("AllSortedIndexes");
"hello world".CountOccurrences(Enumerable.Repeat("l", 1)).Dump("l Occurrences");
"hello world".TextAfter(" ").Dump("2nd word");
"hello world".TextBefore(" ").Dump("1st word");

"test".TextBefore("nope").Dump();
"test".TextAfter("nope").Dump();

"i.e. <ul><li>test 1</li><!-- comment --><li>text 2</li><li>testing</li></ul> - get li texts".AllTextBetween("<li>", "</li>").Dump("simple");
"i.e. <ul><li>test 1</li><!-- comment --><li>text 2</li><li>testing</li></ul> - get <li> texts".AllTextBetween("<li>", "</li>").Dump("no end 1");
"<li>test<li>blah</li>text</li>".AllTextBetween("<li>", "</li>").Dump("2 starts");
"hello;world;testing;text;test".AllTextBetween(";", ";").Dump(";");

Prevent common IEnumerable.Count misuse

Often, Count is used to check if the number of elements in a sequence exceeds a certain amount. But this will enumerate through all elements in a sequence in order to do so, which is unnecessary and affects performance. Therefore an extension method to solve this would be useful.

DataTable to SQL Insert assumptions

the DataTable to SQL Insert method currently only deals with Strings. If a DataTable contains a column with a DateTime value, it should output it in the correct, unambiguous format. Same goes for Booleans, these are represented as bits in SQL.

CSV to DataTable is inefficient

The CSV methods were built for querying directly using deferred-loading, but when populating a DataTable, they are very inefficient.

OpenCSV method bug

Close method is not part of a finally block, meaning there are circumstances where it won't get executed when it should...

Add tests to EnumerableExtensions.CountExceeds

Add tests to EnumerableExtensions.CountExceeds, to prove that it does not iterate over more elements than necessary.

Example using divide by zero exception if it iterated over all elements:

var src = Enumerable.Range(1, 4).Concat(new [] { 0 });
src.Select (s => 1 / s).CountExceeds(3).Dump();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.