Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #13210

Re: string length

From "Peter H. Coffin" <hellsop@ninehells.com>
Newsgroups comp.lang.php
Subject Re: string length
Date 2014-03-18 10:39 -0500
Message-ID <slrnligq4q.74r.hellsop@nibelheim.ninehells.com> (permalink)
References <umgkqacqlbwl.1erkg4bj91fbo$.dlg@40tude.net> <180320141511165855%timstreater@greenbee.net>

Show all headers | View raw


On Tue, 18 Mar 2014 15:11:16 +0000, Tim Streater wrote:
> In article <umgkqacqlbwl.1erkg4bj91fbo$.dlg@40tude.net>, richard
><noreply@example.com> wrote:
>
>> What can I use to count the number of characters in a string?
>> strlen() does not seem to work properly.
>
> IME, it does.
>
>> count_chars() does several different things but does not count the total.
>> In BASIC I would use value=len(a$).
>> I've had a look at the string functions and don't see a one that does this.
>> 
>> what I'm looking to do is, read a directory and load an array based upon
>> certain conditions of the file name.
>> 
>> Using strlen and trying to match the file length to a fixed value does not
>> work for me.
>
> Suggest you give some examples which fail. You sure there are no
> unprintable characters in the filename?
>
> I've never had a problem with strlen.

Wild-assed guess. Multibyte characters biting his bottom. If I'm right,
this will be even more entertaining than third normal form...

-- 
85. I will not use any plan in which the final step is horribly 
    complicated, e.g. "Align the 12 Stones of Power on the sacred altar 
    then activate the medallion at the moment of total eclipse." 
    Instead it will be more along the lines of "Push the button."

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

string length richard <noreply@example.com> - 2014-03-18 10:45 -0400
  Re: string length Tim Streater <timstreater@greenbee.net> - 2014-03-18 15:11 +0000
    Re: string length "Peter H. Coffin" <hellsop@ninehells.com> - 2014-03-18 10:39 -0500
    Re: string length The Natural Philosopher <tnp@invalid.invalid> - 2014-03-18 15:57 +0000
  Re: string length Gabe <usenet@moojuice.net> - 2014-03-18 15:53 +0000
    Re: string length The Natural Philosopher <tnp@invalid.invalid> - 2014-03-18 16:00 +0000
      Re: string length Tim Streater <timstreater@greenbee.net> - 2014-03-18 17:47 +0000
  Re: string length Denis McMahon <denismfmcmahon@gmail.com> - 2014-03-18 22:50 +0000

csiph-web