---
title: "lua string trim"
author: "lua"
date: "2009-12-27T16:26:06Z"
tags: []
categories: ["编程语言"]
slug: "lua-string-trim"
draft: false
lastmod: "2009-12-27T16:26:06Z"
id: 557829
url: "https://lua.iteye.com/blog/557829"
---

function trim(s)  
 local from = s:match"^%s\*()"  
 return from &gt; #s and "" or s:match(".\*%S", from)  
end