How do I loop through a string?

I have tried all of these methods but I still can’t get it working.

Example:

            then:
              - lambda: |-
                      for(std::string::size_type i = 0; i < id(somestring).state.size(); ++i) {
                          ESP_LOGD("%s", id(somestring).state[i]);
                      }
In file included from src/esphome/components/display/display.h:11,
                 from src/esphome/components/display/display_buffer.h:6,
                 from src/esphome/components/addressable_light/addressable_light_display.h:5,
                 from src/esphome.h:3,
                 from src/main.cpp:3:
/config/esphome/waveshare.yaml: In lambda function:
src/esphome/core/log.h:95:100: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   esp_log_printf_(ESPHOME_LOG_LEVEL_DEBUG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
                                                                                                    ^
src/esphome/core/log.h:152:28: note: in expansion of macro 'esph_log_d'
 #define ESP_LOGD(tag, ...) esph_log_d(tag, __VA_ARGS__)
                            ^~~~~~~~~~
/config/esphome/waveshare.yaml:275:11: note: in expansion of macro 'ESP_LOGD'
                           ESP_LOGD("%s", id(somestring).state[i]);
           ^       
src/esphome/core/log.h:56:72: note:   initializing argument 4 of 'void esphome::esp_log_printf_(int, const char*, int, const char*, ...)'
 void esp_log_printf_(int level, const char *tag, int line, const char *format, ...)  // NOLINT

I just can’t get this to work.
My end goal is to use each character in a if/elseif, at least that is what I believe for now.