COMMUNITY

How to get length of BytesData?

target:HL

          var a = "123";

	var b = Bytes.ofString(a);

	var arr = b.getData();

	for (i in 0...arr.length) {
		arr[i] = arr[i] << 1;
	}

characters 21-27 : Cannot access static field length from a class instance

how to fixed?

In general you shouldn’t need to call b.getData()

for(i in 0...b.length) b.set(i, b.get(i) << 1);

thanks @kevinresol I’ll try.