Template:Str sub long/doc: Difference between revisions

m
Text replacement - " " to " "
m (remove { from templates)
m (Text replacement - " " to " ")
 
(2 intermediate revisions by one other user not shown)
Line 10: Line 10:


=== Limitations ===
=== Limitations ===
A string is limited to 500 total characters, but the substring can only span the first 100 characters. The presence of certain characters in the input may cause unexpected results, so {{tlx|Str_sub/any}} should be used to handle any possible character. Otherwise, there can be problems with some special characters. For example, {{tlx|Str sub long|abc%def|2|3}} {{Str sub long|abc%def|2|3}} works as desired, whereas if the output string contains any of <code>:;*#</code> the results are not as desired:<br />
A string is limited to 500 total characters, but the substring can only span the first 100 characters. The presence of certain characters in the input may cause unexpected results, so tlx Str_sub/any should be used to handle any possible character. Otherwise, there can be problems with some special characters. For example, tlx Str sub long|abc%def|2|3 → Str sub long abc%def 2 3 works as desired, whereas if the output string contains any of <code>:;*#</code> the results are not as desired:<br />
{{tlx|Str sub/any|abc:def|2|3}} {{Str sub/any|abc:def|2|3}}<br />
tlx Str sub/any|abc:def|2|3 → Str sub/any|abc:def|2|3<br />
{{tlx|Str sub long|abc:def|2|3}} → {{Str sub long|abc:def|2|3}}<br />
{{tlx|Str sub long|abc:def|2|3}} → {{Str sub long|abc:def|2|3}}<br />
{{tlx|Str sub long|abc;def|2|3}} → {{Str sub long|abc;def|2|3}}<br />
{{tlx|Str sub long|abc;def|2|3}} → {{Str sub long|abc;def|2|3}}<br />
Line 20: Line 20:
* {{Tl|Str sub}}
* {{Tl|Str sub}}
* {{Tl|Str sub long}} - allows 100 characters, but not ":" or ";" or "*"
* {{Tl|Str sub long}} - allows 100 characters, but not ":" or ";" or "*"
* Tl|Str sub/any &nbsp;- allows any character, such as ":" or ";" or "*" or "#"
* Tl|Str sub/any - allows any character, such as ":" or ";" or "*" or "#"
* String templates see also
* String templates see also


Approver, Batcheditor, Moderator, Patroller, Protector, Reviewer, Bots, Bureaucrats, editor, Interface administrators, pagecreator, pagedeleter, Page Ownership admin, Push subscription managers, smwadministrator, smwcurator, smweditor, Suppressors, Administrators, Upload Wizard campaign editors, Widget editors
795,753

edits