Posts

How to split the String values with a word in C#

string str="srinivas<br / >nivas <br / >Sri" Result : List<string> strNames = str.Split(new[] { "<br />" },StringSplitOptions.None).ToList(); Distincr names: List<string> strNames = str.Split(new[] { "<br />" },StringSplitOptions.None).Distinct().ToList();

How to add to List of Strings in one dictonary like dictonary in c#

First u can take 2 list of Strings Var a =new List<string>(){"API","UI"} ; var b=new List<string> (){"Application Programming Interface","User Interface"} ; Result: ===== API = Application Programming Interface UI = User Interface Firs you can create on extension method for this       public static class ExtentionMethod { public static void YDR<T>(this IEnumerable dr,Action<T,int> y) { int initials = 0; foreach (T item in dr) { y(item,initials ++); } } }          public static Dictionary<TKey,TValue> Adding<TKey, TValue>(IEnumerable<TKey> keys,IEnumerable<TValue> values) { var dictonary = new Dictionary<TKey,TValue>(); keys.YDR<TKey>((x,i) => { dictonary .Add(x,values.ElementAt(i)); }); return dictonary; } Use case : ======= Create a class and use this method public Dictionary<...

Convert Time to decimal in C#

Can we take the time value is roughly at 10:30:00 Type1   decimal output= Convert . ToDecimal ( TimeSpan . Parse ( "10:30" ). TotalHours ); Net Approch will be 2 nd Type is var startTime= TimeSpan . Parse ( "10:30" ) ; var endTime=TimeSpan . Parse ( "11:30" ); var result = endTime - startTime; decimal output= result.Hours+result.Minites/60; Here minites should be reater than 0.

Angular sample program with componets 1.5.2 angular

Image
https://drive.google.com/file/d/0B7xqx0jzWa3TbWJoeGxVY0tGLTA/view?usp=sharing If u need to customize this code .u procesed remain thanks you.

How to write Pure java script Program?

Image
Create  the Below  folder structure app.js: ==== function submit() {     var name = document.getElementById("txtName").value;     var code = document.getElementById("txtCode").value;     console.log(name + code); } function turnOffLight() {     var a, b, c;     a = 10;     b = 12;     document.getElementById("tagDisplay").innerHTML = a + b; } function turnOnLight() {     /*Comment Implementation       document.getElementById("tagInnerHtmlBasicTag").innerHTML = 'Sreenivas';     */     var x, y;     x = y;     x += y;//x=x+y;     x -= y;//x=x-y;     x *= y;//x=x*y;     x /= y;//x=x/y;     x = 10;     y = 10;     console.log(x | y);     console.log(x ** y);     console.log(x ^ y);     console.log(x >>> y); ...

How to convert decimal to Double using c#

Hi Friends this is Sreenivas .If u want any technical clarification on .Net i can help u out.Please contact +91-9642411153 1 Double d=decimal.ToDouble("Decimal Value"); 2 Double d= (double)("decimalValue"); 3 Double d=Convert.ToDouble("Decimalvalue");

Sample HTML Design screen

Image
I have html control like Below screen shot < !DOCTYPE   html > < html   xmlns = "http://www.w3.org/1999/xhtml" > < head >      < title ></ title >      < script   src = "Scripts/angular.min.js" ></ script >      < script   src = "Scripts/bootstrap.min.js" ></ script >      < link   href = "Content/bootstrap.min.css"   rel = "stylesheet"   /> </ head > < body >      < div   class = "container-fluid" >          < div   class = "page-header" >< h1   style = " text-align : center ; " > Registation Form </ h1 ></ div >          < div   class = "row" >              ...