Free coupon for initial registration

Get length of string

Contents [hide]

Output

5


Code examples


JavaScript

1
2
let str = "A-B-C";
console.log(str.length);

Perl

1
2
my $str = "A-B-C";
print length($str)."\n";

PHP

1
2
3
<?php
$str = "A-B-C";
print strlen($str)."\n";

Python

1
2
example = "A-B-C"
print(str(len(example)))

Ruby

1
2
str = "A-B-C";
print(str.length.to_s + "\n")
Free coupon for initial registration