|
From: dman <ds...@ri...> - 2001-12-13 14:48:40
|
On Thu, Dec 13, 2001 at 05:29:09PM +0530, Sac...@i2... wrote: | Hi, | | We are using JPython in one of our products. Infact we have just started | using this. | | I am really stuck at one place :-( | | My requirement is to get first 10 characters from a given string A. Does | this language have some built-in function (like strncpy()/ | string.substring() etc) to do so? | | Also, could you please provide some generic API which we can use? It is called "slicing" and can be used on any sequence type (ie list and tuple also). Take a look at the tutorial on www.python.org. The situation given above : s = "a string with more than 10 characters" print s[:10] -D -- "...In the UNIX world, people tend to interpret `non-technical user' as meaning someone who's only ever written one device driver." --Daniel Pead |