forked from amazingfate/help
Replacement done with
find . -name \*.xhp -print0 |xargs -0 -P 0 perl -CS -pi -e \
's#(<link[^>]*?) +name *="[^"]*" *( [^>]+|) *>#$1$2>#g'
(note some inconsistencies with space between name and = and also having
empty value, and some more complicated expression to also clear up
double space before/after the attribute)
translation files will be prepped with:
find */helpcontent2 -name \*.po -print0 |xargs -0 -P 0 perl -CS -pi -e \
$'s#(<link[^>]*?) +name=(?:\\\\"[^"]*\\\\"|\'[^\']*\') *( [^>]+|) *(/?>)#$1$2$3#g unless /^#/'
(note that not all languages use the " as quote character for the
attributes, but that also single quotes appera in the po file. Hence
the use of the shell $'string' syntax to be able to quote ' as \'
It also requires to quote the backslash, so that it needs to be escaped
once for the shell, then another time for perl. Also don't work on
obsolete strings (those are prefixed with #~ in the po files)
Also note that <link..></link> gets turned into <link ../> during
translation extraction (along with removal of the space between the
attribute name and the value), so the pattern needs to be slightly
different here)
Change-Id: I95e53a08e6b0095cd894109ea0de154cc4859d8f
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/143713
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
105 lines
7.1 KiB
XML
105 lines
7.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<helpdocument version="1.0">
|
|
<!--
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*
|
|
* This file incorporates work covered by the following license notice:
|
|
*
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
* with this work for additional information regarding copyright
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
* except in compliance with the License. You may obtain a copy of
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
-->
|
|
|
|
<meta>
|
|
<topic id="textsbasicshared03120314xml" indexer="include" status="PUBLISH">
|
|
<title id="tit" xml-lang="en-US">Split Function</title>
|
|
<filename>/text/sbasic/shared/03120314.xhp</filename>
|
|
</topic>
|
|
</meta>
|
|
|
|
<body>
|
|
|
|
|
|
<section id="split">
|
|
<bookmark xml-lang="en-US" branch="index" id="bm_id3156027">
|
|
<bookmark_value>Split function</bookmark_value>
|
|
</bookmark>
|
|
|
|
|
|
<h1 id="hd_id3156027"><link href="text/sbasic/shared/03120314.xhp">Split Function</link></h1>
|
|
<paragraph id="par_id3155805" role="paragraph" xml-lang="en-US">Returns an array of substrings from a string expression.</paragraph>
|
|
</section>
|
|
|
|
<embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
|
|
<bascode>
|
|
<paragraph id="par_id3153824" role="bascode" xml-lang="en-US">Split (Text As String, delimiter, number)</paragraph>
|
|
</bascode>
|
|
|
|
<embed href="text/sbasic/shared/00000003.xhp#functvalue"/>
|
|
<paragraph id="par_id3154285" role="paragraph" xml-lang="en-US">With Option VBASupport 1: String, with Option VBASupport 0: Variant/String</paragraph>
|
|
|
|
<embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
|
|
<paragraph id="par_id3156023" role="paragraph" xml-lang="en-US"> <emph>Text:</emph> Any string expression.</paragraph>
|
|
<paragraph id="par_id3147560" role="paragraph" xml-lang="en-US"> <emph>delimiter (optional):</emph> A string of one or more characters length that is used to delimit the Text. The default is the space character.</paragraph>
|
|
<paragraph id="par_id3145069" role="paragraph" xml-lang="en-US"> <emph>number (optional):</emph> The number of substrings that you want to return.</paragraph>
|
|
|
|
<embed href="text/sbasic/shared/00000003.xhp#functexample"/>
|
|
|
|
<section id="splitjoinex">
|
|
<bascode>
|
|
<paragraph id="par_idm1341285008" role="bascode" localize="false" xml-lang="en-US">Dim a(3)</paragraph>
|
|
<paragraph id="par_idm1341283776" role="bascode" localize="false" xml-lang="en-US">Sub main()</paragraph>
|
|
<paragraph id="par_idm1341282544" role="bascode" localize="false" xml-lang="en-US"> a(0) = "ABCDE"</paragraph>
|
|
<paragraph id="par_idm1341281312" role="bascode" localize="false" xml-lang="en-US"> a(1) = 42</paragraph>
|
|
<paragraph id="par_idm1341280080" role="bascode" localize="false" xml-lang="en-US"> a(2) = "MN"</paragraph>
|
|
<paragraph id="par_idm1341278848" role="bascode" localize="false" xml-lang="en-US"> a(3) = "X Y Z"</paragraph>
|
|
<paragraph id="par_idm1341277616" role="bascode" localize="false" xml-lang="en-US"> JStr = Join1()</paragraph>
|
|
<paragraph id="par_idm1341276384" role="bascode" localize="false" xml-lang="en-US"> Call Show(JStr, Split1(JStr))</paragraph>
|
|
<paragraph id="par_idm1341275136" role="bascode" localize="false" xml-lang="en-US"> JStr = Join2()</paragraph>
|
|
<paragraph id="par_idm1341273904" role="bascode" localize="false" xml-lang="en-US"> Call Show(JStr, Split1(JStr))</paragraph>
|
|
<paragraph id="par_idm1341272656" role="bascode" localize="false" xml-lang="en-US"> JStr = Join3()</paragraph>
|
|
<paragraph id="par_idm1341271424" role="bascode" localize="false" xml-lang="en-US"> Call Show(JStr, Split1(JStr))</paragraph>
|
|
<paragraph id="par_idm1341270176" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph>
|
|
<paragraph id="par_idm1341268944" role="bascode" localize="false" xml-lang="en-US"> </paragraph>
|
|
<paragraph id="par_idm1341267696" role="bascode" localize="false" xml-lang="en-US">Function Join1()</paragraph>
|
|
<paragraph id="par_idm1341266464" role="bascode" localize="false" xml-lang="en-US"> Join1 = Join(a(), "abc")</paragraph>
|
|
<paragraph id="par_idm1341265216" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph>
|
|
<paragraph id="par_idm1341263984" role="bascode" localize="false" xml-lang="en-US"> </paragraph>
|
|
<paragraph id="par_idm1341262784" role="bascode" localize="false" xml-lang="en-US">Function Join2()</paragraph>
|
|
<paragraph id="par_idm1341261552" role="bascode" localize="false" xml-lang="en-US"> Join2 = Join(a(), ",")</paragraph>
|
|
<paragraph id="par_idm1341260304" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph>
|
|
<paragraph id="par_idm1341259072" role="bascode" localize="false" xml-lang="en-US"> </paragraph>
|
|
<paragraph id="par_idm1341257872" role="bascode" localize="false" xml-lang="en-US">Function Join3()</paragraph>
|
|
<paragraph id="par_idm1341256640" role="bascode" localize="false" xml-lang="en-US"> Join3 = Join(a())</paragraph>
|
|
<paragraph id="par_idm1341255408" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph>
|
|
<paragraph id="par_idm1341254176" role="bascode" localize="false" xml-lang="en-US"> </paragraph>
|
|
<paragraph id="par_idm1341252976" role="bascode" localize="false" xml-lang="en-US">Function Split1(aStr)</paragraph>
|
|
<paragraph id="par_idm1341251744" role="bascode" localize="false" xml-lang="en-US"> Split1 = Split(aStr, "D")</paragraph>
|
|
<paragraph id="par_idm1341250496" role="bascode" localize="false" xml-lang="en-US">End Function</paragraph>
|
|
<paragraph id="par_idm1341249264" role="bascode" localize="false" xml-lang="en-US"> </paragraph>
|
|
<paragraph id="par_idm1341248064" role="bascode" localize="false" xml-lang="en-US">Sub Show(JoinStr, TheArray)</paragraph>
|
|
<paragraph id="par_idm1341246816" role="bascode" localize="false" xml-lang="en-US"> l = LBound(TheArray)</paragraph>
|
|
<paragraph id="par_idm1341245568" role="bascode" localize="false" xml-lang="en-US"> u = UBound(TheArray)</paragraph>
|
|
<paragraph id="par_idm1341244320" role="bascode" localize="false" xml-lang="en-US"> total$ = "=============================" + Chr$(13) + JoinStr + Chr$(13) + Chr$(13)</paragraph>
|
|
<paragraph id="par_idm1341243024" role="bascode" localize="false" xml-lang="en-US"> For i = l To u</paragraph>
|
|
<paragraph id="par_idm1341241792" role="bascode" localize="false" xml-lang="en-US"> total$ = total$ + TheArray(i) + Str(Len(TheArray(i))) + Chr$(13)</paragraph>
|
|
<paragraph id="par_idm1341240496" role="bascode" localize="false" xml-lang="en-US"> Next i</paragraph>
|
|
<paragraph id="par_idm1341239264" role="bascode" localize="false" xml-lang="en-US"> MsgBox total$</paragraph>
|
|
<paragraph id="par_idm1341238032" role="bascode" localize="false" xml-lang="en-US">End Sub</paragraph>
|
|
</bascode>
|
|
</section>
|
|
<section id="relatedtopics">
|
|
<paragraph role="paragraph" id="par_id161599082457466" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#stringfunctions"/></paragraph>
|
|
</section>
|
|
</body>
|
|
|
|
</helpdocument>
|