top of page

14

Beginner

AZ_textSliceChenger

[#]区切り文字列を分割して取得

RANK

dofile(reaper.AZ_GetLuaInitPath())


s = "1,2,3,4,5,6#1,1,1,0,1,1#3,4,5,4,5,65,4,6"


function  textSliceChenger(str)

local c = 0

local y = {}

    for x in str:gmatch("([^#]*)")do

        c = c + 1

        y[c]= x

    end

return y

end


a = textSliceChenger(s)

Msg(a[1])

Msg(a[2])

Msg(a[3])

dofile(reaper.AZ_GetLuaInitPath())


s = "1,2,3,4,5,6#1,1,1,0,1,1#3,4,5,4,5,65,4,6"


  • 「#」区切りの文字列を用意する。


function  textSliceChenger(str)


  • 「#」区切り文字列を配列に格納する関数を定義する。


local c = 0

local y = {}


  • カウント用の変数、戻り値格納用配列を定義する。


for x in str:gmatch("([^#]*)")do

c = c + 1

y[c]= x

end


  • 引数(str)を「#」で分割し、分割後の文字列の数だけ処理を繰り返す。

  • 繰り返すたびに変数(c)を加算する。

  • 配列の(c)番目に分割後の文字列を格納する。


return y

end

To use the API, you need to sign up for a plan.

Download the dedicated API

need to do it.

*SILVER is scheduled to be released in May.

準備の必要はありません

- Script Code -
- Script Image -
- Warm Up -
- Script Detail -
- API -

LUA

​ReaScript File Download 👇

* A dedicated API is required to run this

- Script Image -
bottom of page