Message from discussion
Duvida com Strings.
Received: by 10.236.191.40 with SMTP id f28mr37823961yhn.2.1341442223763;
Wed, 04 Jul 2012 15:50:23 -0700 (PDT)
X-BeenThere: lua-br@googlegroups.com
Received: by 10.236.122.145 with SMTP id t17ls14001029yhh.4.gmail; Wed, 04 Jul
2012 15:50:22 -0700 (PDT)
Received: by 10.236.79.198 with SMTP id i46mr31027635yhe.4.1341442222662;
Wed, 04 Jul 2012 15:50:22 -0700 (PDT)
Received: by 10.236.79.198 with SMTP id i46mr31027632yhe.4.1341442222653;
Wed, 04 Jul 2012 15:50:22 -0700 (PDT)
Return-Path: <to...@tecgraf.puc-rio.br>
Received: from mail.tecgraf.puc-rio.br (mail2.tecgraf.puc-rio.br. [139.82.85.2])
by gmr-mx.google.com with ESMTP id a57si6334029yhh.5.2012.07.04.15.50.22;
Wed, 04 Jul 2012 15:50:22 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of to...@tecgraf.puc-rio.br designates 139.82.85.2 as permitted sender) client-ip=139.82.85.2;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of to...@tecgraf.puc-rio.br designates 139.82.85.2 as permitted sender) smtp.mail=to...@tecgraf.puc-rio.br
Received: from mail.tecgraf.puc-rio.br (localhost.localdomain [127.0.0.1])
by mail.tecgraf.puc-rio.br (Postfix) with ESMTP id CE16E294348
for <lua-br@googlegroups.com>; Wed, 4 Jul 2012 19:50:21 -0300 (BRT)
Received: from magritte (magritte [10.0.8.92])
by mail.tecgraf.puc-rio.br (Postfix) with ESMTP id B9DDB294343
for <lua-br@googlegroups.com>; Wed, 4 Jul 2012 19:50:21 -0300 (BRT)
Date: Wed, 4 Jul 2012 19:50:21 -0300 (BRT)
From: Tomas Guisasola Gorham <to...@tecgraf.puc-rio.br>
To: lua-br@googlegroups.com
Subject: Re: [lua-br] Duvida com Strings.
In-Reply-To: <CA+sgB-4CEmLpyBimH-upva6Wv90aYsY0REcfE-T+eKANY0-Eqg@mail.gmail.com>
Message-ID: <Pine.LNX.4.64.1207041948330.11377@magritte.tecgraf.puc-rio.br>
References: <CA+sgB-4CEmLpyBimH-upva6Wv90aYsY0REcfE-T+eKANY0-Eqg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1786358726-1341442221=:11377"
X-Virus-Scanned: ClamAV
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--8323328-1786358726-1341442221=:11377
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT
> A string em quest�o pode ser gigante, com v�rios espa�os, etc ...
> Por�m quero sempre quebrar ela em duas na primeira ocorr�ncia de um espa�o,
> por exemplo se eu tivesse:
>
> S = "Andrws Aires Vieira"
>
> Preciso quebrar assim:
>
> S1 = "Andrws" e S2 = "Aires Vieira"
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> S = "Andrws Aires Vieira"
> S1, S2 = S:match"^(%S+) (.*)$"
> =S1
Andrws
> =S2
Aires Vieira
Abra�o,
Tom�s
--8323328-1786358726-1341442221=:11377--