473,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Middle of word

N9
Hi

It's possible to substring middle ??

text = "Here are a story about a boy, who like to play baseball"

I split on word "who", with 10 char to left and 10 char til right,
that the result gone be.

text = "out a boy who, like to "

Hope some one could help me.

Thanks

//N9
Jun 27 '08 #1
2 1324
N9 wrote:
It's possible to substring middle ??
Your example doesn't seem to have anything to do with XSLT, unless test
is an attribute.
Jun 27 '08 #2
N9 wrote:
Hi

It's possible to substring middle ??

text = "Here are a story about a boy, who like to play baseball"

I split on word "who", with 10 char to left and 10 char til right,
that the result gone be.

text = "out a boy who, like to "

Hope some one could help me.

Thanks

//N9
You should look up XPath rather than XSLT, and you will
want the string functions:

substring-before, substring-after, substring, string-length

and possibly 'concat' and 'contains'
for example:

substring(substring-after("Here is a story about a boy, who likes to
play baseball","who"),4,11)

evaluates to 'kes to play'

Note that the second parameter is a request for a length od substring,
not the final position.

Assuming the source text is the content of an xml element, you would use
<xsl:value-of>, possibly normalise spaces, and almost certainly wish to
use a variable.

Also not thet the 'substring-before' and 'substring-after' functions
only return the first match,
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ams | last post by:
A table contains records of Ice Cream flavors. There is a primary id field (INT) and a varchar for flavor. I need to get the row in the very middle of the table, however I can't assume that the...
5
by: Poonam | last post by:
Hi Can we align an image or content vertically middle in a DIV. tks poonam
4
by: lindsey.crocker | last post by:
I have this links list with background images set on them which changes when they roll over. The <td> is set valign="middle" however as soon as you apply the rollover to the link, the text jumps...
1
by: Galina | last post by:
Hello I generate a pritty complicate report in my application. The report is so complicate in fact that I sort and format records in code, form a long string and assign it to an unbounded field on...
15
by: Hi5 | last post by:
Hi, I am designing a database for a client in which It has a client table including the followings: 1-Table Client 2-Table lookupcategory 3-Table Ctegory
6
by: Ian Williamson | last post by:
Greetings, My company has an ASP.NET based enterprise product that is undergoing some changes and I need some community input to help solve a problem. In the current implementation, any given...
2
by: rhino | last post by:
I'm working on a layout that has a variable-height middle section and need some suggestions on how I can make the bottom section adapt to that situation. Basically, I have: - a fixed-length,...
23
by: Himanshu Chauhan | last post by:
Hi! I was wondering, In the first parse of a singly linked list of unknown length, is it possible to know when we are at middle of the linked list? Regards --Himanshu
4
by: mdthom08 | last post by:
I need to return the middle 2 characters of a word, favoring the right. so for example: SevenMethods myFuns = new SevenMethods(); assertEquals("34", myFuns.middleTwo("12345")); so far i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.