turtlestitch/libraries/strings.xml

1 wiersz
8.9 KiB
XML
Czysty Zwykły widok Historia

<blocks app="Snap! 7, https://snap.berkeley.edu" version="2"><block-definition s="multiline %&apos;text&apos;" type="reporter" category="operators"><header></header><code></code><translations>pt:o texto multilinha _&#xD;ca:multilínia _&#xD;</translations><inputs><input type="%mlt"></input></inputs><script><block s="doReport"><block var="text"/></block></script></block-definition><block-definition s="substring of %&apos;string&apos; before %&apos;marker&apos;" type="reporter" category="operators"><comment w="175.33333333333334" collapsed="false">Reports the part of the first string up to the first instance of the second string inside it. If the second string isn&apos;t found, reports the entire first string.</comment><header></header><code></code><translations>pt:o texto de _ antes de _&#xD;ca:part del text _ anterior a _&#xD;</translations><inputs><input type="%txt"></input><input type="%txt"></input></inputs><script><block s="doDeclareVariables"><list><l>index</l></list></block><block s="doSetVar"><l>index</l><custom-block s="position of %s in %txt"><block var="marker"/><block var="string"/></custom-block></block><block s="doReport"><block s="reportIfElse"><block s="reportEquals"><block var="index"/><l>0</l></block><block var="string"/><block s="reportIfElse"><block s="reportEquals"><block var="index"/><l>1</l></block><l></l><custom-block s="substring of %txt from position %n to position %n inclusive"><block var="string"/><l>1</l><block s="reportDifference"><block var="index"/><l>1</l></block></custom-block></block></block></block></script></block-definition><block-definition s="substring of %&apos;string&apos; after %&apos;marker&apos;" type="reporter" category="operators"><comment w="203.33333333333334" collapsed="false">Reports the portion of the first input string starting after the first occurrence of the second string. If the second string isn&apos;t found in the first string, reports an empty string.</comment><header></header><code></code><translations>pt:o texto de _ depois de _&#xD;ca:part del text _ posterior a _&#xD;</translations><inputs><input type="%txt"></input><input type="%txt"></input></inputs><script><block s="doDeclareVariables"><list><l>index</l><l>end</l></list></block><block s="doSetVar"><l>index</l><custom-block s="position of %s in %txt"><block var="marker"/><block var="string"/></custom-block></block><block s="doSetVar"><l>end</l><block s="reportSum"><block var="index"/><block s="reportStringSize"><block var="marker"/></block></block></block><block s="doReport"><block s="reportIfElse"><block s="reportEquals"><block var="index"/><l>0</l></block><l></l><block s="reportIfElse"><block s="reportGreaterThan"><block var="end"/><block s="reportStringSize"><block var="string"/></block></block><l></l><custom-block s="substring of %txt from position %n to position %n inclusive"><block var="string"/><block var="end"/><l></l></custom-block></block></block></block></script></block-definition><block-definition s="position of %&apos;small&apos; in %&apos;large&apos;" type="reporter" category="operators"><comment x="0" y="0" w="294" collapsed="false">Reports the character position (starting from 1) of the beginning of the first input string inside the second input string.&#xD;If it&apos;s not found, reports 0.</comment><header></header><code></code><translations>pt:a posição de _ em _&#xD;ca:posició de _ en _&#xD;</translations><inputs><input type="%s"></input><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportIfElse"><custom-block s="use case-independent comparison"></custom-block><block s="reportApplyExtension"><l>txt_indexof(sub, txt)</l><list><custom-block s="to lower case %txt"><block var="small"/></custom-block><custom-block s="to lower case %txt"><block var="large"/></custom-block></list></block><block s="reportApplyExtension"><l>txt_indexof(sub, txt)</l><list><block var="small"/><block var="large"/></list></block></block></block></script></block-definition><block-definition s="use case-independent comparisons %&apos;tf&apos;" type="command" category="operators"><comme