.net - Generic Concat Extension method for Paramarrays not working for IEnumerable(of String) -


Inspired by the JavaScript variables in Max () / min () and in the understanding of the list of functional languages, I get it Try using VB.NET Generic Extension Methods as a result of IEnumerable (TK). Why does this work well for the string? Such expanding methods can be considered a bad idea. Why any strong reason why this is a bad idea.

  Clear option on import system strict. Runtime. Compiler Service Module Module 1 Sub Head () dim xs IEnumerable (as integer) = 1.Concat (2, 3, 4) IEnumerable (string of) = concat ("1", "2", "3", "4") 'idle, but works as IEnumerable = 1.0.Concat (2.0, 3.0, 4.0) dim zs I will use a stringbuilder 'dim zs2 as IEnumerable (string) = "1". Why does Konkat ("2", "3", "4")' Why does not work? 'Returns:' string 'can not be converted to' system '. Selection. Generic Inaarable (string) '' because () 'four' is not derived from 'string', as' Out 'in the generic parameter' T '' interface IEnumerable (out of K) '' C: \ Users \ ques \ Documents \ Visual Studio 10 \ Projects \ Virgin's Experimental \ Ware's Experiment \ Module 1 VB1245WirersEnterprise Console Redline () and subs and lt extension ()> gt; IEnumerable (tK) = params.Asumerable as IEnumerable (TK) dims as the function () of the CONNECT (TK) (as IEnumerable as X), byVal ParamArray parameter T () () Xs.Concat returns Ys) and function & lt; Extension () & gt; Xs.Add (x) of new list (T) as IEnumerable (TK) dim x in the form of _ _ function concat (TK) (as T, as the variable paramay parametres) Moderate ys (TK) = parameter as IEnumerable. Maximum numeric return xs.Concat (ys) and function and module  

... cut als for the rest of the module Some methods have been written for an application for add, cast and action objects.

A string is a IEnumerable & lt; Char & gt; , and there is no connection between a string and char. You can think of it as a problem with dimension, string can generally be considered as an array of four [] four It is not equal, nor will it ever be a system. String concat, which also applies to mess with your type of signature, you may want to be careful with that.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -