01: package org.methodize.nntprss.util;
02:
03: /* -----------------------------------------------------------
04: * nntp//rss - a bridge between the RSS world and NNTP clients
05: * Copyright (c) 2002, 2003 Jason Brome. All Rights Reserved.
06: *
07: * email: nntprss@methodize.org
08: * mail: Methodize Solutions
09: * PO Box 3865
10: * Grand Central Station
11: * New York NY 10163
12: *
13: * This file is part of nntp//rss
14: *
15: * nntp//rss is free software; you can redistribute it
16: * and/or modify it under the terms of the GNU General
17: * Public License as published by the Free Software Foundation;
18: * either version 2 of the License, or (at your option) any
19: * later version.
20: *
21: * This program is distributed in the hope that it will be
22: * useful, but WITHOUT ANY WARRANTY; without even the implied
23: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
24: * PURPOSE. See the GNU General Public License for more
25: * details.
26: *
27: * You should have received a copy of the GNU General Public
28: * License along with this program; if not, write to the
29: * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
30: * Boston, MA 02111-1307 USA
31: * ----------------------------------------------------- */
32:
33: /**
34: * @author Jason Brome <jason@methodize.org>
35: * @version $Id: RSSHelper.java,v 1.2 2003/03/24 03:15:06 jasonbrome Exp $
36: */
37:
38: public class RSSHelper {
39:
40: /**
41: * Parses RSS email string to return email
42: *
43: * Typically:
44: *
45: * someone@someone.com (My name)
46: */
47: public static String parseEmail(String email) {
48: String parsedEmail = null;
49:
50: int spacePos = email.indexOf(' ');
51:
52: if (spacePos == -1) {
53: parsedEmail = email;
54: } else {
55: parsedEmail = email.substring(0, spacePos);
56: }
57:
58: return parsedEmail;
59:
60: }
61: }
|