Loading ...
Sorry, an error occurred while loading the content.

a simple question...

Expand Messages
  • Jadi, SoftHome
    hI, Can real beginners ask questions ? :) I want to browse a String char by char. I ve used to do in C this way : for (int i, i
    Message 1 of 2 , Feb 2, 2003
    • 0 Attachment
      hI, Can real beginners ask questions ? :)
      I want to browse a String char by char. I've used to
      do in C this way :

      for (int i, i<length(str), i++)
      str[i]='A';

      how can I access to the n'th char in a string ? I'm using

      substr $str, $n, 1;

      but there must be a better way.

      Jadi


      [Non-text portions of this message have been removed]
    • Charles K. Clarkson
      ... No. substr is about the fastest way to do it. What are you trying to accomplish?
      Message 2 of 2 , Feb 2, 2003
      • 0 Attachment
        Jadi, SoftHome [jadi@...] wrote:

        :
        : I want to browse a String char by char. I've used to
        : do in C this way :
        :
        : for (int i, i<length(str), i++)
        : str[i]='A';
        :
        : how can I access to the n'th char in a string ? I'm using
        :
        : substr $str, $n, 1;
        :
        : but there must be a better way.

        No. substr is about the fastest way to do it. What
        are you trying to accomplish?
      Your message has been successfully submitted and would be delivered to recipients shortly.