Difference between revisions of "LlReplaceSubString/ja"

From Second Life Wiki
Jump to navigation Jump to search
(copy from english(Todo: need translate to japanese))
 
m
Line 1: Line 1:
{{LSL_Function
{{LSL_Function/ja
|func_id=|func_sleep=0.0|func_energy=10.0
|func_id=|func_sleep=0.0|func_energy=10.0
|sort=ReplaceSubString
|sort=ReplaceSubString
Line 49: Line 49:
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetSubString]]|}}
{{LSL DefineRow||[[llGetSubString/ja]]|}}
{{LSL DefineRow||[[llDeleteSubString]]|}}
{{LSL DefineRow||[[llDeleteSubString/ja]]|}}
{{LSL DefineRow||[[llInsertString]]|}}
{{LSL DefineRow||[[llInsertString/ja]]|}}
{{LSL DefineRow||[[llDeleteSubList]]|}}
{{LSL DefineRow||[[llDeleteSubList/ja]]|}}
|also_events
|also_events
|also_articles=
|also_articles=

Revision as of 13:15, 2 November 2023

要約

関数: string llReplaceSubString( string src, string pattern, string replacement_pattern, integer count );

that is the result of replacing the first count matching instances pattern in src with replacement_pattern.を string で返します。

• string src
• string pattern
• string replacement_pattern
• integer count

If count = 0, all matching substrings are replaced. If count > 0, substrings are replaced starting from the left/beginning of src. If count < 0, substrings are replaced starting from the right/end of src.

サンプル

default
{
    state_entry()
    {
        string ex = "red foxes, red hens, red turnips";
        // Replace first 2 matches, starting from the left side
        ex = llReplaceSubString(ex, "red", "blue", 2);
        llSay(0, ex); // Should say "blue foxes, blue hens, red turnips"
    }
}
default
{
    state_entry()
    {
        string ex = "red foxes, red hens, red turnips";
        // Replace first match, starting from the right side
        ex = llReplaceSubString(ex, "red", "green", -1);
        llSay(0, ex); // Should say "red foxes, red hens, green turnips"
    }
}
default
{
    state_entry()
    {
        string ex = "red foxes, red hens, red turnips";
        // Replace all matches
        ex = llReplaceSubString(ex, "red", "yellow", 0);
        llSay(0, ex); // Should say "yellow foxes, yellow hens, yellow turnips"
    }
}

関連項目

特記事項

Search JIRA for related Issues

Signature

function string llReplaceSubString( string src, string pattern, string replacement_pattern, integer count );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。