|
2405 | 2405 |
|
2406 | 2406 | @see https://haxe.org/manual/types-abstract-array-access.html</haxe_doc></class> |
2407 | 2407 | <class path="String" params="" file="/home/runner/work/haxe/haxe/std/hl/_std/String.hx"> |
2408 | | - <fromCharCode public="1" set="method" line="178" static="1"> |
| 2408 | + <fromCharCode public="1" set="method" line="177" static="1"> |
2409 | 2409 | <f a="code"> |
2410 | 2410 | <x path="Int"/> |
2411 | 2411 | <c path="String"/> |
|
2415 | 2415 | If `code` is negative or has another invalid value, the result is |
2416 | 2416 | unspecified.</haxe_doc> |
2417 | 2417 | </fromCharCode> |
2418 | | - <__alloc__ get="inline" set="null" line="214" static="1"> |
| 2418 | + <__alloc__ get="inline" set="null" line="213" static="1"> |
2419 | 2419 | <f a="b:length"> |
2420 | 2420 | <x path="hl.Bytes"/> |
2421 | 2421 | <x path="Int"/> |
|
2426 | 2426 | <m n=":keep"/> |
2427 | 2427 | </meta> |
2428 | 2428 | </__alloc__> |
2429 | | - <call_toString set="method" line="221" static="1"> |
| 2429 | + <call_toString set="method" line="220" static="1"> |
2430 | 2430 | <f a="v"> |
2431 | 2431 | <d/> |
2432 | 2432 | <x path="hl.Bytes"/> |
2433 | 2433 | </f> |
2434 | 2434 | <meta><m n=":keep"/></meta> |
2435 | 2435 | </call_toString> |
2436 | | - <fromUCS2 get="inline" set="null" line="226" static="1"> |
| 2436 | + <fromUCS2 get="inline" set="null" line="225" static="1"> |
2437 | 2437 | <f a="b"> |
2438 | 2438 | <x path="hl.Bytes"/> |
2439 | 2439 | <c path="String"/> |
2440 | 2440 | </f> |
2441 | 2441 | <meta><m n=":has_untyped"/></meta> |
2442 | 2442 | </fromUCS2> |
2443 | | - <fromUTF8 set="method" line="233" static="1"> |
| 2443 | + <fromUTF8 set="method" line="232" static="1"> |
2444 | 2444 | <f a="b"> |
2445 | 2445 | <x path="hl.Bytes"/> |
2446 | 2446 | <c path="String"/> |
2447 | 2447 | </f> |
2448 | 2448 | <meta><m n=":keep"/></meta> |
2449 | 2449 | </fromUTF8> |
2450 | | - <CHARS expr="new hl.NativeArray<String>(256)" line="243" static="1"> |
| 2450 | + <CHARS expr="new hl.NativeArray<String>(256)" line="242" static="1"> |
2451 | 2451 | <x path="hl.NativeArray"><c path="String"/></x> |
2452 | 2452 | <meta><m n=":value"><e><![CDATA[new hl.NativeArray<String>(256)]]></e></m></meta> |
2453 | 2453 | </CHARS> |
2454 | | - <__char__ set="method" line="244" static="1"> |
| 2454 | + <__char__ set="method" line="243" static="1"> |
2455 | 2455 | <f a="code"> |
2456 | 2456 | <x path="Int"/> |
2457 | 2457 | <c path="String"/> |
2458 | 2458 | </f> |
2459 | 2459 | <meta><m n=":keep"/></meta> |
2460 | 2460 | </__char__> |
2461 | | - <__add__ set="method" line="262" static="1"> |
| 2461 | + <__add__ set="method" line="261" static="1"> |
2462 | 2462 | <f a="a:b"> |
2463 | 2463 | <c path="String"/> |
2464 | 2464 | <c path="String"/> |
|
2584 | 2584 |
|
2585 | 2585 | If `len` is omitted, all characters from position `pos` to the end of |
2586 | 2586 | `this` String are included. |
| 2587 | + ```haxe |
| 2588 | + "abcde".substr(3) // de |
| 2589 | + ``` |
2587 | 2590 |
|
2588 | 2591 | If `pos` is negative, its value is calculated from the end of `this` |
2589 | 2592 | String by `this.length + pos`. If this yields a negative value, 0 is |
2590 | 2593 | used instead. |
| 2594 | + ```haxe |
| 2595 | + "abcde".substr(-2) // de |
| 2596 | + ``` |
2591 | 2597 |
|
2592 | | - If the calculated position + `len` exceeds `this.length`, the characters |
2593 | | - from that position to the end of `this` String are returned. |
| 2598 | + If `len` is positive, up to `len` characters from the calculated position |
| 2599 | + to the end of `this` String are included. |
| 2600 | + ```haxe |
| 2601 | + "abcde".substr(1, 2) // bc |
| 2602 | + ``` |
2594 | 2603 |
|
2595 | | - If `len` is negative, the result is unspecified.</haxe_doc> |
| 2604 | + If `len` is negative, all characters from the calculated position to the end |
| 2605 | + of `this` String, except the last `abs(len)` characters, are included. |
| 2606 | + ```haxe |
| 2607 | + "abcde".substr(0, -2) // abc |
| 2608 | + "abcde".substr(1, -2) // bc |
| 2609 | + ``` |
| 2610 | + |
| 2611 | + If the calculated position + `len` exceeds `this.length`, the characters |
| 2612 | + from that position to the end of `this` String are returned.</haxe_doc> |
2596 | 2613 | </substr> |
2597 | | - <substring public="1" set="method" line="151"> |
| 2614 | + <substring public="1" set="method" line="150"> |
2598 | 2615 | <f a="startIndex:?endIndex"> |
2599 | 2616 | <x path="Int"/> |
2600 | 2617 | <x path="Int"/> |
|
2612 | 2629 | If the (possibly swapped) `startIndex` exceeds `this.length`, the empty |
2613 | 2630 | String `""` is returned.</haxe_doc> |
2614 | 2631 | </substring> |
2615 | | - <toString public="1" set="method" line="174"> |
| 2632 | + <toString public="1" set="method" line="173"> |
2616 | 2633 | <f a=""><c path="String"/></f> |
2617 | 2634 | <haxe_doc>Returns the String itself.</haxe_doc> |
2618 | 2635 | </toString> |
2619 | | - <toUtf8 set="method" line="194"><f a=""><x path="hl.Bytes"/></f></toUtf8> |
2620 | | - <__string set="method" line="198"> |
| 2636 | + <toUtf8 set="method" line="193"><f a=""><x path="hl.Bytes"/></f></toUtf8> |
| 2637 | + <__string set="method" line="197"> |
2621 | 2638 | <f a=""><x path="hl.Bytes"/></f> |
2622 | 2639 | <meta><m n=":keep"/></meta> |
2623 | 2640 | </__string> |
2624 | | - <__compare set="method" line="202"> |
| 2641 | + <__compare set="method" line="201"> |
2625 | 2642 | <f a="v"> |
2626 | 2643 | <d/> |
2627 | 2644 | <x path="Int"/> |
|
0 commit comments