Skip to content

Instantly share code, notes, and snippets.

@urstory
Created January 19, 2016 07:23
Show Gist options
  • Save urstory/305ebd7f90df8bd9d106 to your computer and use it in GitHub Desktop.
Save urstory/305ebd7f90df8bd9d106 to your computer and use it in GitHub Desktop.
소스코드의 라인넘버를 삭제하기
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>linenumber</title>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script>
$(function(){
$("#changeBtn").click(function() {
var source = $("#source").val();
var lineArray = source.split("\n");
var str = '';
$.each(lineArray, function(index, line){
var num = line.indexOf(": ", 0);
if(num != -1){
line = line.substring(num + 2);
}
str += line + "\n";
});
$("#destination").val(str);
});
});
</script>
</head>
<body>
<h1>소스코드 라인넘버 삭제</h1>
<br>
<textarea id="source" cols="70" rows="7"></textarea>
<br>
<br>
<input type="button" id="changeBtn" value="소스변환"/>
<br>
<br>
<textarea id="destination" cols="70" rows="7"></textarea>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment