#include #include #include using namespace std; string solution(string my_string, string overwrite_string, int s) { string answer = ""; int num = overwrite_string.size(); int index = 0; for(int i = s ; i < num + s; i++){ my_string[i] = overwrite_string[index]; index++; } answer = my_string; cout
문자열을 변수와 결합해서(concatenation) 출력 결합하기는 문자열에만 사용되기 때문에 문자열과 연결하려는 변수가 정수 데이터 유형이면 str() 함수를 사용해 문자열로 변환해야함 name = "python" print("Language" + name + "is Best") # Languagepythonis Best print("Language " + name + " is Best") # Language python is Best age = 23 print("Age is " + age) # ERROR print("Age is " + str(age)) # Age is 23 변수와 문자열을 쉼표로 구분하여 출력 name = "python" print("Name is",name) # Name is py..
upper(): 문자열을 대문자로 변환 str = "python" str.upper() print(str) # PYTHON lower(): 문자열을 소문자로 변환 str = "PYTHON" str.lower() print(str) # python capitalize(): 맨 앞 문자만 대문자 나머지는 소문자 str = "python" str.capitalize() print(str) # Python title(): 문자열의 각 단어의 첫 글자를 대문자로 변환 str = "python is language" str.title() print(str) # Python Is Language swapcase(): 문자열에 있는 모든 문자의 대/소문자를 반대로 변환 str = "pYtHoN" str.swapcase..

UIImage는 단지 데이터이다. 이를 디코딩하면 비로소 이미지의 의미를 갖게된다. 디코딩한것을 화면에 보여주는것을 렌더링이라고 한다. 데이터 -> 이미지데이터로 변환하는 디코딩은 많은 CPU 사용량을 차지한다. 애초에 데이터를 줄여주면 변환하는 디코딩에 사용되는 CPU는 적어질 것이다. "UIGraphicsImageRenderer" 은 이미지 데이터를 설정한 크기로 줄이고 디코딩후에 렌더링 할 수있게 도와준다. 참고로 이미지 데이터 UIImage는 "imageView.image = UIIMage" 할때 디코딩 되고 렌더링이 된다. 사용법은 private func downImageSize(image:UIImage,newWidth:CGFloat) -> UIImage{ let scale = newWidth ..