Getting index from strsplit or strfind in a null (00) terminated string
Mostrar comentarios más antiguos
I have a long string with chunks of data. Each data chunk is separated/terminated by null (hex 00). Right now I use strsplit(data, '\0') to split the string, which works fine, but it returns a cell array with data, however, I rather need the functionality of strfind and get a list of indices for where the string is split.
Example of data:
data_chunk "null/0x00" data_chunk "null/0x00" data_chunk "null/0x00"
I know the first chunk is obviously at index 0, but I would also like to get the indices of the remaining chunks.
Is it possible to use strfind and search for null?
2 comentarios
Azzi Abdelmalek
el 10 de Abr. de 2016
Post clearly your data, for example:
str='null/0x00'
Then explain what is the expected result
result=?
Simon
el 10 de Abr. de 2016
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!