A Pen by JunsukPark on CodePen.
A Pen by JunsukPark on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function titleCase(str) { | |
var list = str.split(' '); | |
var newList = list.map(function(arg){ | |
var firstString = arg[0]; | |
var restString = arg.split(arg[0]).join(''); | |
firstString = firstString.toUpperCase(); | |
restString = restString.toLowerCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Java0719_api; | |
import java.util.StringTokenizer; | |
/** | |
* Created by Junsuk on 2016-07-19. | |
*/ | |
public class Java128_StringTokenizer { | |
public static void main(String[] args) { | |
StringTokenizer st = new StringTokenizer("java,,jsp", ","); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Java0719_api; | |
/* | |
* sn변수에 저장된 문자열중에서 숫자갯수를 출력하는 프로그램을 구현하시오. | |
* [출력결과] | |
* 숫자갯수:3 | |
*/ | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Java0719_api; | |
import java.util.LinkedHashSet; | |
import java.util.Random; | |
import java.util.Set; | |
/* | |
* [문제] | |
* 1~20 사이의 난수 10개를 발생시켜 배열에 저장한 후에 리턴하는 | |
* makeArray() 메서드와 생성된 배열에서 중복된 숫자를 제거하고 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
f = open("regex_sum_300257.txt","r") | |
lines = f.readlines() | |
sum = 0 | |
for line in lines: | |
line = line.rstrip() | |
x = re.findall('[0-9]+',line) | |
for number in x: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package java0720_api; | |
import java.util.Arrays; | |
import java.util.stream.IntStream; | |
/** | |
* Created by Junsuk on 2016-07-20. | |
*/ | |
public class Java142_System { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String[] arrTest = { "1", "2", "3"}; | |
List alTest = new ArrayList(Arrays.asList(arrTest)); | |
String[] arrTest2 = { "4", "5", "6"}; | |
Collections.addAll(alTest, arrTest2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StreamExercise { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
String[] strings = {"d2", "a2", "b1", "b3", "c"}; | |
Arrays.asList(strings).stream().filter(x->{ | |
return x.startsWith("a"); | |
} | |
).forEach(x-> System.out.println(x)); | |
OlderNewer