Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
parsowanie daty
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here string formatString = "dd.MM.yyyy"; string sampleData = "01.06.2015"; DateTime d; DateTime.TryParseExact(sampleData, formatString, null, System.Globalization.DateTimeStyles.None, out d); Console.WriteLine(d); formatString = "dd.MM.yyyy"; sampleData = "06.2015"; DateTime.TryParseExact(sampleData, formatString, null, System.Globalization.DateTimeStyles.None, out d); Console.WriteLine(d); string t1 = "data waż.06.2015"; string t2 = "data waż.06.2015 5907377130604"; string t3 = "data waż.20.06.2015 5907377130604 yv46 refxer erfr"; Regex rg = new Regex(@"^data waż\.((\d+)\.*\d+\.\d+)(\s+([^\s]*)){0,1}"); string t = t3; if(rg.Match(t).Success) { Console.WriteLine(rg.Match(t).Groups[1].Value); Console.WriteLine(rg.Match(t).Groups[4].Value); } int a=1; int.TryParse("x",out a); Console.WriteLine(a); } } }
run
|
edit
|
history
|
help
0
Golden Ratio Approximation
Exception
remove special char c#
Pascal Triangle
C# Basic learning
655+99
Arreglo
AAAXACAdxcd
see all nodes in given ldap node
input