Article View: borland.public.jbuilder.java.swing
Article #11249Re: JTextfield substring
From: Yasser
Date: Tue, 22 Jun 1999 00:00
Date: Tue, 22 Jun 1999 00:00
25 lines
1256 bytes
1256 bytes
Thanks yasser Steve Horsley wrote: > Try something like this (I assume you want the last 10 chars): > > int end = textfield.getText().length(); > int start = end - 10; > if(start < 0) > start = 0; > String sub = textfield.getText().substring(start, end); > > Steve > //----------------------- > Yasser wrote: > > > > Wanted to know if there is a function that can return to me part of a > > string entered in a JTextfield. substring(start pos,end pos) reads a > > string from the starting position to the ending position ... in my case > > wanted to read the string from its ending position to a specified number > > of characters.. > > > > yasser
Technical Details
Message-ID:
<376FB019.ED9A1F68@cs.twsu.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<376EC3B4.CEFFDD0@cs.twsu.edu> <376F4EAE.1A03F259@cwcom.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,5c1fc6a6fbec69de X-Google-Attributes: gid111d45,public From: Yasser <ymsherif@cs.twsu.edu> Subject: Re: JTextfield substring Date: 1999/06/22 Message-ID: <376FB019.ED9A1F68@cs.twsu.edu> X-Deja-AN: 492552573 Content-Transfer-Encoding: 7bit References: <376EC3B4.CEFFDD0@cs.twsu.edu> <376F4EAE.1A03F259@cwcom.co.uk> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing