The data in memory is only binary data. That is, there are only 0s and 1s.
Memory does not distinguish between data types. You have to understand this.
You use this memory through high-level language statements. So, if you pass the variable name a, it is of type integer. If you pass the variable name B, it is of character type.
To use the data of B(1:4), just write B(1:4) directly, such as write(*,*) B(1:4)