DateTime dt = new DateTime(2018, 11, 3, 23, 18, 22); //2018년 11월 3일 23시 18분 22초 "yyyy-MM-dd tt hh:mm:ss (ddd)" //2018-11-03 오후 11:18:22 (토) yy : 18 yyyy : 2018 M : 1 MM : 01 d : 8 dd : 08 h : 9 hh : 09 H : 21 HH : 21 m : 3 mm : 03 s : 7 ss : 07 tt : 오전, 오후 ddd : 토 dddd : 토요일
IndexOf() //현재 문자열 내에서 찾고자 하는 지정된 문자 또는 문자열 위치 찾음 LastIndexOf() //현재 문자열 내에서 찾고자 하는 지정된 문자 또는 문자열 위치를 뒤에서 부터 찾음 StartsWith() //현재 문자열이 지정된 문자열로 시작하는지 평가 EndsWith() //현재 문자열이 지정된 문자열로 끝나는지 평가 Contains() //현재 문자열이 지정된 문자열이 포함하는지 평가 Replace() //현재 문자열에서 지정된 문자열이 다른 지정된 문자열로 모두 바뀐 새 문자열 반환
모든 데이터 형식은 object 형식을 상속받고 있다. 이 메소드는 해당 변수의 실제 형식을 알려준다. class Animal { } class Dog : Animal { } void PrintTypes(Animal a) { Console.WriteLine(a.GetType() == typeof(Animal)); // false Console.WriteLine(a is Animal); // true Console.WriteLine(a.GetType() == typeof(Dog)); // true } 한 사이트에서 가져온 예시이며, Dog라는 Class는 Animal을 상속 받고 있습니다. 상속 받은 Dog의 경우 GetType() == typeof(Animal)로 비교 시 Dog클래스는 Animal를 상..
Null + able int? a = null; float? b = null;
string to int string a = "123"; int b = (int)a; int to string int c = 123; string d = (string)c; int to float int a = int.Parse("12345"); float = float.Parse("123.45"); int, float to string int c= 123; string d = c.Tostring(); float e = 123.45; string f = e.Tostring();
웹팩으로 빌드한 결과물이 변경되지 않았으면 계속 캐싱 상태로 남겨서, 별도의 HTTP 요청이 발생하지 않도록 하는 기법에 대해서 정리. [contenthash]는 변경된 내용이 있을경우 해쉬코드로 알아서 변경되니, 사용자는 새로운 버전을 항상 받을 수 밖에 없음 캐쉬 지울필요도 없고 개꿀 webpack.config.js const path = require('path'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: './src/index.js', plugins: [ // new Clea..
- Total
- Today
- Yesterday