String.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="String" category="Built-In Types" version="3.1">
  3. <brief_description>
  4. Built-in string class.
  5. </brief_description>
  6. <description>
  7. This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference counted and use a copy-on-write approach, so passing them around is cheap in resources.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="String">
  15. <return type="String">
  16. </return>
  17. <argument index="0" name="from" type="bool">
  18. </argument>
  19. <description>
  20. Constructs a new String from the given [bool].
  21. </description>
  22. </method>
  23. <method name="String">
  24. <return type="String">
  25. </return>
  26. <argument index="0" name="from" type="int">
  27. </argument>
  28. <description>
  29. Constructs a new String from the given [int].
  30. </description>
  31. </method>
  32. <method name="String">
  33. <return type="String">
  34. </return>
  35. <argument index="0" name="from" type="float">
  36. </argument>
  37. <description>
  38. Constructs a new String from the given [float].
  39. </description>
  40. </method>
  41. <method name="String">
  42. <return type="String">
  43. </return>
  44. <argument index="0" name="from" type="Vector2">
  45. </argument>
  46. <description>
  47. Constructs a new String from the given [Vector2].
  48. </description>
  49. </method>
  50. <method name="String">
  51. <return type="String">
  52. </return>
  53. <argument index="0" name="from" type="Rect2">
  54. </argument>
  55. <description>
  56. Constructs a new String from the given [Rect2].
  57. </description>
  58. </method>
  59. <method name="String">
  60. <return type="String">
  61. </return>
  62. <argument index="0" name="from" type="Vector3">
  63. </argument>
  64. <description>
  65. Constructs a new String from the given [Vector3].
  66. </description>
  67. </method>
  68. <method name="String">
  69. <return type="String">
  70. </return>
  71. <argument index="0" name="from" type="Transform2D">
  72. </argument>
  73. <description>
  74. Constructs a new String from the given [Transform2D].
  75. </description>
  76. </method>
  77. <method name="String">
  78. <return type="String">
  79. </return>
  80. <argument index="0" name="from" type="Plane">
  81. </argument>
  82. <description>
  83. Constructs a new String from the given [Plane].
  84. </description>
  85. </method>
  86. <method name="String">
  87. <return type="String">
  88. </return>
  89. <argument index="0" name="from" type="Quat">
  90. </argument>
  91. <description>
  92. Constructs a new String from the given [Quat].
  93. </description>
  94. </method>
  95. <method name="String">
  96. <return type="String">
  97. </return>
  98. <argument index="0" name="from" type="AABB">
  99. </argument>
  100. <description>
  101. Constructs a new String from the given [AABB].
  102. </description>
  103. </method>
  104. <method name="String">
  105. <return type="String">
  106. </return>
  107. <argument index="0" name="from" type="Basis">
  108. </argument>
  109. <description>
  110. Constructs a new String from the given [Basis].
  111. </description>
  112. </method>
  113. <method name="String">
  114. <return type="String">
  115. </return>
  116. <argument index="0" name="from" type="Transform">
  117. </argument>
  118. <description>
  119. Constructs a new String from the given [Transform].
  120. </description>
  121. </method>
  122. <method name="String">
  123. <return type="String">
  124. </return>
  125. <argument index="0" name="from" type="Color">
  126. </argument>
  127. <description>
  128. Constructs a new String from the given [Color].
  129. </description>
  130. </method>
  131. <method name="String">
  132. <return type="String">
  133. </return>
  134. <argument index="0" name="from" type="NodePath">
  135. </argument>
  136. <description>
  137. Constructs a new String from the given [NodePath].
  138. </description>
  139. </method>
  140. <method name="String">
  141. <return type="String">
  142. </return>
  143. <argument index="0" name="from" type="RID">
  144. </argument>
  145. <description>
  146. Constructs a new String from the given [RID].
  147. </description>
  148. </method>
  149. <method name="String">
  150. <return type="String">
  151. </return>
  152. <argument index="0" name="from" type="Dictionary">
  153. </argument>
  154. <description>
  155. Constructs a new String from the given [Dictionary].
  156. </description>
  157. </method>
  158. <method name="String">
  159. <return type="String">
  160. </return>
  161. <argument index="0" name="from" type="Array">
  162. </argument>
  163. <description>
  164. Constructs a new String from the given [Array].
  165. </description>
  166. </method>
  167. <method name="String">
  168. <return type="String">
  169. </return>
  170. <argument index="0" name="from" type="PoolByteArray">
  171. </argument>
  172. <description>
  173. Constructs a new String from the given [PoolByteArray].
  174. </description>
  175. </method>
  176. <method name="String">
  177. <return type="String">
  178. </return>
  179. <argument index="0" name="from" type="PoolIntArray">
  180. </argument>
  181. <description>
  182. Constructs a new String from the given [PoolIntArray].
  183. </description>
  184. </method>
  185. <method name="String">
  186. <return type="String">
  187. </return>
  188. <argument index="0" name="from" type="PoolRealArray">
  189. </argument>
  190. <description>
  191. Constructs a new String from the given [PoolRealArray].
  192. </description>
  193. </method>
  194. <method name="String">
  195. <return type="String">
  196. </return>
  197. <argument index="0" name="from" type="PoolStringArray">
  198. </argument>
  199. <description>
  200. Constructs a new String from the given [PoolStringArray].
  201. </description>
  202. </method>
  203. <method name="String">
  204. <return type="String">
  205. </return>
  206. <argument index="0" name="from" type="PoolVector2Array">
  207. </argument>
  208. <description>
  209. Constructs a new String from the given [PoolVector2Array].
  210. </description>
  211. </method>
  212. <method name="String">
  213. <return type="String">
  214. </return>
  215. <argument index="0" name="from" type="PoolVector3Array">
  216. </argument>
  217. <description>
  218. Constructs a new String from the given [PoolVector3Array].
  219. </description>
  220. </method>
  221. <method name="String">
  222. <return type="String">
  223. </return>
  224. <argument index="0" name="from" type="PoolColorArray">
  225. </argument>
  226. <description>
  227. Constructs a new String from the given [PoolColorArray].
  228. </description>
  229. </method>
  230. <method name="begins_with">
  231. <return type="bool">
  232. </return>
  233. <argument index="0" name="text" type="String">
  234. </argument>
  235. <description>
  236. Returns [code]true[/code] if the string begins with the given string.
  237. </description>
  238. </method>
  239. <method name="bigrams">
  240. <return type="PoolStringArray">
  241. </return>
  242. <description>
  243. Returns the bigrams (pairs of consecutive letters) of this string.
  244. </description>
  245. </method>
  246. <method name="c_escape">
  247. <return type="String">
  248. </return>
  249. <description>
  250. Returns a copy of the string with special characters escaped using the C language standard.
  251. </description>
  252. </method>
  253. <method name="c_unescape">
  254. <return type="String">
  255. </return>
  256. <description>
  257. Returns a copy of the string with escaped characters replaced by their meanings according to the C language standard.
  258. </description>
  259. </method>
  260. <method name="capitalize">
  261. <return type="String">
  262. </return>
  263. <description>
  264. Changes the case of some letters. Replaces underscores with spaces, converts all letters to lowercase, then capitalizes first and every letter following the space character. For [code]capitalize camelCase mixed_with_underscores[/code] it will return [code]Capitalize Camelcase Mixed With Underscores[/code].
  265. </description>
  266. </method>
  267. <method name="casecmp_to">
  268. <return type="int">
  269. </return>
  270. <argument index="0" name="to" type="String">
  271. </argument>
  272. <description>
  273. Performs a case-sensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
  274. </description>
  275. </method>
  276. <method name="dedent">
  277. <return type="String">
  278. </return>
  279. <description>
  280. Removes indentation from string.
  281. </description>
  282. </method>
  283. <method name="empty">
  284. <return type="bool">
  285. </return>
  286. <description>
  287. Returns [code]true[/code] if the string is empty.
  288. </description>
  289. </method>
  290. <method name="ends_with">
  291. <return type="bool">
  292. </return>
  293. <argument index="0" name="text" type="String">
  294. </argument>
  295. <description>
  296. Returns [code]true[/code] if the string ends with the given string.
  297. </description>
  298. </method>
  299. <method name="erase">
  300. <argument index="0" name="position" type="int">
  301. </argument>
  302. <argument index="1" name="chars" type="int">
  303. </argument>
  304. <description>
  305. Erases [code]chars[/code] characters from the string starting from [code]position[/code].
  306. </description>
  307. </method>
  308. <method name="find">
  309. <return type="int">
  310. </return>
  311. <argument index="0" name="what" type="String">
  312. </argument>
  313. <argument index="1" name="from" type="int" default="0">
  314. </argument>
  315. <description>
  316. Finds the first occurrence of a substring. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
  317. </description>
  318. </method>
  319. <method name="find_last">
  320. <return type="int">
  321. </return>
  322. <argument index="0" name="what" type="String">
  323. </argument>
  324. <description>
  325. Finds the last occurrence of a substring. Returns the starting position of the substring or -1 if not found.
  326. </description>
  327. </method>
  328. <method name="findn">
  329. <return type="int">
  330. </return>
  331. <argument index="0" name="what" type="String">
  332. </argument>
  333. <argument index="1" name="from" type="int" default="0">
  334. </argument>
  335. <description>
  336. Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
  337. </description>
  338. </method>
  339. <method name="format">
  340. <return type="String">
  341. </return>
  342. <argument index="0" name="values" type="Variant">
  343. </argument>
  344. <argument index="1" name="placeholder" type="String" default="{_}">
  345. </argument>
  346. <description>
  347. Formats the string by replacing all occurrences of [code]placeholder[/code] with [code]values[/code].
  348. </description>
  349. </method>
  350. <method name="get_base_dir">
  351. <return type="String">
  352. </return>
  353. <description>
  354. If the string is a valid file path, returns the base directory name.
  355. </description>
  356. </method>
  357. <method name="get_basename">
  358. <return type="String">
  359. </return>
  360. <description>
  361. If the string is a valid file path, returns the full file path without the extension.
  362. </description>
  363. </method>
  364. <method name="get_extension">
  365. <return type="String">
  366. </return>
  367. <description>
  368. If the string is a valid file path, returns the extension.
  369. </description>
  370. </method>
  371. <method name="get_file">
  372. <return type="String">
  373. </return>
  374. <description>
  375. If the string is a valid file path, returns the filename.
  376. </description>
  377. </method>
  378. <method name="hash">
  379. <return type="int">
  380. </return>
  381. <description>
  382. Hashes the string and returns a 32-bit integer.
  383. </description>
  384. </method>
  385. <method name="hex_to_int">
  386. <return type="int">
  387. </return>
  388. <description>
  389. Converts a string containing a hexadecimal number into an integer.
  390. </description>
  391. </method>
  392. <method name="insert">
  393. <return type="String">
  394. </return>
  395. <argument index="0" name="position" type="int">
  396. </argument>
  397. <argument index="1" name="what" type="String">
  398. </argument>
  399. <description>
  400. Inserts a substring at a given position.
  401. </description>
  402. </method>
  403. <method name="is_abs_path">
  404. <return type="bool">
  405. </return>
  406. <description>
  407. If the string is a path to a file or directory, returns [code]true[/code] if the path is absolute.
  408. </description>
  409. </method>
  410. <method name="is_rel_path">
  411. <return type="bool">
  412. </return>
  413. <description>
  414. If the string is a path to a file or directory, returns [code]true[/code] if the path is relative.
  415. </description>
  416. </method>
  417. <method name="is_subsequence_of">
  418. <return type="bool">
  419. </return>
  420. <argument index="0" name="text" type="String">
  421. </argument>
  422. <description>
  423. Returns [code]true[/code] if this string is a subsequence of the given string.
  424. </description>
  425. </method>
  426. <method name="is_subsequence_ofi">
  427. <return type="bool">
  428. </return>
  429. <argument index="0" name="text" type="String">
  430. </argument>
  431. <description>
  432. Returns [code]true[/code] if this string is a subsequence of the given string, without considering case.
  433. </description>
  434. </method>
  435. <method name="is_valid_float">
  436. <return type="bool">
  437. </return>
  438. <description>
  439. Returns [code]true[/code] if this string contains a valid float.
  440. </description>
  441. </method>
  442. <method name="is_valid_hex_number">
  443. <return type="bool">
  444. </return>
  445. <argument index="0" name="with_prefix" type="bool" default="False">
  446. </argument>
  447. <description>
  448. Returns [code]true[/code] if this string contains a valid hexadecimal number. If [code]with_prefix[/code] is [code]true[/code], then a validity of the hexadecimal number is determined by [code]0x[/code] prefix, for instance: [code]0xDEADC0DE[/code].
  449. </description>
  450. </method>
  451. <method name="is_valid_html_color">
  452. <return type="bool">
  453. </return>
  454. <description>
  455. Returns [code]true[/code] if this string contains a valid color in HTML notation.
  456. </description>
  457. </method>
  458. <method name="is_valid_identifier">
  459. <return type="bool">
  460. </return>
  461. <description>
  462. Returns [code]true[/code] if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (_) and the first character may not be a digit.
  463. </description>
  464. </method>
  465. <method name="is_valid_integer">
  466. <return type="bool">
  467. </return>
  468. <description>
  469. Returns [code]true[/code] if this string contains a valid integer.
  470. </description>
  471. </method>
  472. <method name="is_valid_ip_address">
  473. <return type="bool">
  474. </return>
  475. <description>
  476. Returns [code]true[/code] if this string contains a valid IP address.
  477. </description>
  478. </method>
  479. <method name="json_escape">
  480. <return type="String">
  481. </return>
  482. <description>
  483. Returns a copy of the string with special characters escaped using the JSON standard.
  484. </description>
  485. </method>
  486. <method name="left">
  487. <return type="String">
  488. </return>
  489. <argument index="0" name="position" type="int">
  490. </argument>
  491. <description>
  492. Returns a number of characters from the left of the string.
  493. </description>
  494. </method>
  495. <method name="length">
  496. <return type="int">
  497. </return>
  498. <description>
  499. Returns the string's amount of characters.
  500. </description>
  501. </method>
  502. <method name="lstrip">
  503. <return type="String">
  504. </return>
  505. <argument index="0" name="chars" type="String">
  506. </argument>
  507. <description>
  508. Returns a copy of the string with characters removed from the left.
  509. </description>
  510. </method>
  511. <method name="match">
  512. <return type="bool">
  513. </return>
  514. <argument index="0" name="expr" type="String">
  515. </argument>
  516. <description>
  517. Does a simple expression match, where '*' matches zero or more arbitrary characters and '?' matches any single character except '.'.
  518. </description>
  519. </method>
  520. <method name="matchn">
  521. <return type="bool">
  522. </return>
  523. <argument index="0" name="expr" type="String">
  524. </argument>
  525. <description>
  526. Does a simple case insensitive expression match, using ? and * wildcards (see [method match]).
  527. </description>
  528. </method>
  529. <method name="md5_buffer">
  530. <return type="PoolByteArray">
  531. </return>
  532. <description>
  533. Returns the MD5 hash of the string as an array of bytes.
  534. </description>
  535. </method>
  536. <method name="md5_text">
  537. <return type="String">
  538. </return>
  539. <description>
  540. Returns the MD5 hash of the string as a string.
  541. </description>
  542. </method>
  543. <method name="nocasecmp_to">
  544. <return type="int">
  545. </return>
  546. <argument index="0" name="to" type="String">
  547. </argument>
  548. <description>
  549. Performs a case-insensitive comparison to another string. Returns [code]-1[/code] if less than, [code]+1[/code] if greater than, or [code]0[/code] if equal.
  550. </description>
  551. </method>
  552. <method name="ord_at">
  553. <return type="int">
  554. </return>
  555. <argument index="0" name="at" type="int">
  556. </argument>
  557. <description>
  558. Returns the character code at position [code]at[/code].
  559. </description>
  560. </method>
  561. <method name="pad_decimals">
  562. <return type="String">
  563. </return>
  564. <argument index="0" name="digits" type="int">
  565. </argument>
  566. <description>
  567. Formats a number to have an exact number of [code]digits[/code] after the decimal point.
  568. </description>
  569. </method>
  570. <method name="pad_zeros">
  571. <return type="String">
  572. </return>
  573. <argument index="0" name="digits" type="int">
  574. </argument>
  575. <description>
  576. Formats a number to have an exact number of [code]digits[/code] before the decimal point.
  577. </description>
  578. </method>
  579. <method name="percent_decode">
  580. <return type="String">
  581. </return>
  582. <description>
  583. Decode a percent-encoded string. See [method percent_encode].
  584. </description>
  585. </method>
  586. <method name="percent_encode">
  587. <return type="String">
  588. </return>
  589. <description>
  590. Percent-encodes a string. Encodes parameters in a URL when sending a HTTP GET request (and bodies of form-urlencoded POST requests).
  591. </description>
  592. </method>
  593. <method name="plus_file">
  594. <return type="String">
  595. </return>
  596. <argument index="0" name="file" type="String">
  597. </argument>
  598. <description>
  599. If the string is a path, this concatenates [code]file[/code] at the end of the string as a subpath. E.g. [code]"this/is".plus_file("path") == "this/is/path"[/code].
  600. </description>
  601. </method>
  602. <method name="replace">
  603. <return type="String">
  604. </return>
  605. <argument index="0" name="what" type="String">
  606. </argument>
  607. <argument index="1" name="forwhat" type="String">
  608. </argument>
  609. <description>
  610. Replaces occurrences of a substring with the given one inside the string.
  611. </description>
  612. </method>
  613. <method name="replacen">
  614. <return type="String">
  615. </return>
  616. <argument index="0" name="what" type="String">
  617. </argument>
  618. <argument index="1" name="forwhat" type="String">
  619. </argument>
  620. <description>
  621. Replaces occurrences of a substring with the given one inside the string. Ignores case.
  622. </description>
  623. </method>
  624. <method name="rfind">
  625. <return type="int">
  626. </return>
  627. <argument index="0" name="what" type="String">
  628. </argument>
  629. <argument index="1" name="from" type="int" default="-1">
  630. </argument>
  631. <description>
  632. Performs a search for a substring, but starts from the end of the string instead of the beginning.
  633. </description>
  634. </method>
  635. <method name="rfindn">
  636. <return type="int">
  637. </return>
  638. <argument index="0" name="what" type="String">
  639. </argument>
  640. <argument index="1" name="from" type="int" default="-1">
  641. </argument>
  642. <description>
  643. Performs a search for a substring, but starts from the end of the string instead of the beginning. Ignores case.
  644. </description>
  645. </method>
  646. <method name="right">
  647. <return type="String">
  648. </return>
  649. <argument index="0" name="position" type="int">
  650. </argument>
  651. <description>
  652. Returns the right side of the string from a given position.
  653. </description>
  654. </method>
  655. <method name="rsplit">
  656. <return type="PoolStringArray">
  657. </return>
  658. <argument index="0" name="divisor" type="String">
  659. </argument>
  660. <argument index="1" name="allow_empty" type="bool" default="True">
  661. </argument>
  662. <argument index="2" name="maxsplit" type="int" default="0">
  663. </argument>
  664. <description>
  665. Splits the string by a [code]divisor[/code] string and returns an array of the substrings, starting from right.
  666. [b]Example:[/b] "One,Two,Three" will return ["One","Two","Three"] if split by ",".
  667. If [code]maxsplit[/code] is specified, then it is number of splits to do, default is 0 which splits all the items.
  668. </description>
  669. </method>
  670. <method name="rstrip">
  671. <return type="String">
  672. </return>
  673. <argument index="0" name="chars" type="String">
  674. </argument>
  675. <description>
  676. Returns a copy of the string with characters removed from the right.
  677. </description>
  678. </method>
  679. <method name="sha256_buffer">
  680. <return type="PoolByteArray">
  681. </return>
  682. <description>
  683. Returns the SHA-256 hash of the string as an array of bytes.
  684. </description>
  685. </method>
  686. <method name="sha256_text">
  687. <return type="String">
  688. </return>
  689. <description>
  690. Returns the SHA-256 hash of the string as a string.
  691. </description>
  692. </method>
  693. <method name="similarity">
  694. <return type="float">
  695. </return>
  696. <argument index="0" name="text" type="String">
  697. </argument>
  698. <description>
  699. Returns the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar.
  700. </description>
  701. </method>
  702. <method name="split">
  703. <return type="PoolStringArray">
  704. </return>
  705. <argument index="0" name="divisor" type="String">
  706. </argument>
  707. <argument index="1" name="allow_empty" type="bool" default="True">
  708. </argument>
  709. <argument index="2" name="maxsplit" type="int" default="0">
  710. </argument>
  711. <description>
  712. Splits the string by a divisor string and returns an array of the substrings.
  713. [b]Example:[/b] "One,Two,Three" will return ["One","Two","Three"] if split by ",".
  714. If [code]maxsplit[/code] is given, at most maxsplit number of splits occur, and the remainder of the string is returned as the final element of the list (thus, the list will have at most maxsplit+1 elements)
  715. </description>
  716. </method>
  717. <method name="split_floats">
  718. <return type="PoolRealArray">
  719. </return>
  720. <argument index="0" name="divisor" type="String">
  721. </argument>
  722. <argument index="1" name="allow_empty" type="bool" default="True">
  723. </argument>
  724. <description>
  725. Splits the string in floats by using a divisor string and returns an array of the substrings.
  726. [b]Example:[/b] "1,2.5,3" will return [1,2.5,3] if split by ",".
  727. </description>
  728. </method>
  729. <method name="strip_edges">
  730. <return type="String">
  731. </return>
  732. <argument index="0" name="left" type="bool" default="True">
  733. </argument>
  734. <argument index="1" name="right" type="bool" default="True">
  735. </argument>
  736. <description>
  737. Returns a copy of the string stripped of any non-printable character at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively.
  738. </description>
  739. </method>
  740. <method name="substr">
  741. <return type="String">
  742. </return>
  743. <argument index="0" name="from" type="int">
  744. </argument>
  745. <argument index="1" name="len" type="int">
  746. </argument>
  747. <description>
  748. Returns part of the string from the position [code]from[/code] with length [code]len[/code].
  749. </description>
  750. </method>
  751. <method name="to_ascii">
  752. <return type="PoolByteArray">
  753. </return>
  754. <description>
  755. Converts the String (which is a character array) to [PoolByteArray] (which is an array of bytes). The conversion is sped up in comparison to to_utf8() with the assumption that all the characters the String contains are only ASCII characters.
  756. </description>
  757. </method>
  758. <method name="to_float">
  759. <return type="float">
  760. </return>
  761. <description>
  762. Converts a string containing a decimal number into a [code]float[/code].
  763. </description>
  764. </method>
  765. <method name="to_int">
  766. <return type="int">
  767. </return>
  768. <description>
  769. Converts a string containing an integer number into an [code]int[/code].
  770. </description>
  771. </method>
  772. <method name="to_lower">
  773. <return type="String">
  774. </return>
  775. <description>
  776. Returns the string converted to lowercase.
  777. </description>
  778. </method>
  779. <method name="to_upper">
  780. <return type="String">
  781. </return>
  782. <description>
  783. Returns the string converted to uppercase.
  784. </description>
  785. </method>
  786. <method name="to_utf8">
  787. <return type="PoolByteArray">
  788. </return>
  789. <description>
  790. Converts the String (which is an array of characters) to [PoolByteArray] (which is an array of bytes). The conversion is a bit slower than to_ascii(), but supports all UTF-8 characters. Therefore, you should prefer this function over to_ascii().
  791. </description>
  792. </method>
  793. <method name="trim_prefix">
  794. <return type="String">
  795. </return>
  796. <argument index="0" name="prefix" type="String">
  797. </argument>
  798. <description>
  799. Removes a given string from the start if it starts with it or leaves the string unchanged.
  800. </description>
  801. </method>
  802. <method name="trim_suffix">
  803. <return type="String">
  804. </return>
  805. <argument index="0" name="suffix" type="String">
  806. </argument>
  807. <description>
  808. Removes a given string from the end if it ends with it or leaves the string unchanged.
  809. </description>
  810. </method>
  811. <method name="xml_escape">
  812. <return type="String">
  813. </return>
  814. <description>
  815. Returns a copy of the string with special characters escaped using the XML standard.
  816. </description>
  817. </method>
  818. <method name="xml_unescape">
  819. <return type="String">
  820. </return>
  821. <description>
  822. Returns a copy of the string with escaped characters replaced by their meanings according to the XML standard.
  823. </description>
  824. </method>
  825. </methods>
  826. <constants>
  827. </constants>
  828. </class>