Re: [xsl] How to get the trailing spaces in a string?

Subject: Re: [xsl] How to get the trailing spaces in a string?
From: "John Lumley john@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 8 Jul 2024 13:07:32 -0000
On 08/07/2024 13:49, John Lumley john@xxxxxxxxxxxx wrote:
Sorry - misread your requirement:

replace(AirportName,'^(.*[^ ])?( +$)','$2')

where $2 will any trailing spaces after an optional sequence ending in a 
non-space. I'm sure there's a shorter one....


> On 08/07/2024 13:41, Roger L Costello costello@xxxxxxxxx wrote:
>> Hi Folks,
>>
>> The value of this element contains trailing spaces:
>>
>> <Airport_Name>LOWELL FLD                    </Airport_Name>
>>
>> A few days ago Martin showed how to obtain the string before the trailing spaces. (Thanks Martin!)
>>
>> Now I need to obtain the trailing spaces. How to do that?
> replace(AirportName,' +$','')
>
> You should read up the examples of fn:replace() and brush up on 
> regular expressions
>
>> /Roger
>>
>>

-- 
*John Lumley* MA PhD CEng FIEE
john@xxxxxxxxxxxx

Current Thread