Skip to content

Commit 5079538

Browse files
committed
move split method
1 parent c4a7f6c commit 5079538

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

3.database-connection/server.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,10 @@ http.createServer(function (req, res) {
3333
console.log('requiredQueryString :');
3434
console.log(requiredQueryString);
3535

36-
//example spilt string
37-
var str = "/de/about";
38-
var path = str.split("/");
39-
console.log(path); // path = [ '', 'de', 'about' ]
40-
// path[1] = 'de', path[2] = 'about'
4136

4237

43-
var pathnames = parsedRouteUrl.pathname.split('/');
44-
var parametres = pathnames.filter(n => n != '');
38+
var pathnames = parsedRouteUrl.pathname.split('/'); // ['','student','1']
39+
var parametres = pathnames.filter(n => n != ''); // ['student','1']
4540
console.log('pathnames :' + pathnames);
4641
console.log('parametres :' + parametres);
4742

common/program.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
4+
//example spilt string
5+
var str = "/de/about";
6+
var path = str.split("/");
7+
console.log(path); // path = [ '', 'de', 'about' ]
8+
// path[1] = 'de', path[2] = 'about'

0 commit comments

Comments
 (0)