截取部分文本
-
先修科目
什么是分隔符?
分隔符就是把文本分割成若干部分的字符或文本。
例如,文本“欢迎来到|泉城济南”可以用字符“|”分割成2部分:第1部分为“欢迎来到”,第2部分为“泉城济南”。
积木:“用( )分割( )后的第( )部分”
这个积木是运算类别的报表积木。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/08904c53-e594-43c6-8cb9-4a24a5286336.png" width="750" style="">
当你运行积木“用(分隔符)分割(文本)后的第(几)部分”,该积木首先用分隔符把文本分割成几部分,然后根据第几部分返回那一部分。任何字符都可以作为分隔符。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5699c827-ec33-445f-9c4a-e4b9d057da8a.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
默认分隔符
积木“用( )分割( )后的第( )部分”的默认分隔符为“空格”。所以,如果你不修改“用”后面的输入框,文本就将用空格分割。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/7f1d6c4c-e7ea-4ab5-8de3-bbba704fb05c.gif" width="800" style="border-radius: 5px; border: 1px solid #29622d;">
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login