-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
19 lines (16 loc) · 780 Bytes
/
script.js
File metadata and controls
19 lines (16 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Farklı boşluk türleri içeren string
var complexText = "\t\n Merhaba Dünya! \n\t";
var temizComplexText = complexText.trim();
document.write("Temizlenmiş Complex Text: '" + temizComplexText + "'"); // Output: Merhaba Dünya!
// Boşluk içeren string
var text = " deneme ";
var result = text.trim();
document.write(result); // Output: deneme
// Boşluk içermeyen string
var noSpaceText = "JavaScript";
var resultNoSpace = noSpaceText.trim();
document.write("Boşluk Olmayan Metin: '" + resultNoSpace + "'"); // Output: JavaScript
// Sadece boşluklardan oluşan string
var onlySpaces = " ";
var temizOnlySpaces = onlySpaces.trim();
document.write("Sadece Boşluklardan Oluşan Metin: '" + temizOnlySpaces + "'"); // Output: ''