Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
różne wersje parsowania kwoty i daty (CultureInfo)
//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; using System.Globalization; namespace Rextester { public class Program { public static void Main(string[] args) { string kwS = "1316,1"; double kwD = 0d; List<string> kultury = new List<string>() {"de-DE", "en-US", "pl-PL", "fr-FR", "it-IT"}; foreach(string clt in kultury) { CultureInfo cltI = new CultureInfo(clt); double.TryParse(kwS, NumberStyles.Currency, cltI, out kwD); Console.WriteLine(string.Format("{0}: {1}",cltI.Name,kwD)); } string frm = "yyyy+MM+dd"; string dt = "2013+12+31"; DateTime wartosc; if(DateTime.TryParseExact(dt, frm, null, DateTimeStyles.AssumeLocal, out wartosc)) Console.WriteLine("Data - OK."); foreach(string clt in kultury) { CultureInfo cltI = new CultureInfo(clt); Console.WriteLine(string.Format("{0}: {1}", cltI.Name, wartosc.ToString(cltI))); } } } }
run
|
edit
|
history
|
help
0
Arrange Hex string in a new one as a byte array declaration
ConcurrentStack<T>
Changing asp net user password
Linq FirstOrDefault() null check in c#
123
Problem Name: single_digit
Unary example
Encapsulation and abstration
Math 5.85a
DateTime