---
title: "javascript 随笔"
author: "hb_keepmoving"
date: "2013-07-15T16:03:49Z"
tags: []
categories: ["Web前端"]
slug: "javascript"
draft: false
lastmod: "2013-07-15T16:03:49Z"
id: 1906589
url: "https://hb-keepmoving.iteye.com/blog/1906589"
---

```
//去掉两端空格
function trim(stringToTrim) {
      return stringToTrim.replace(/^\s+|\s+$/g, "");
}
```