Determine if a string has all the same characters: Difference between revisions
Content added Content deleted
(→{{header|S-BASIC}}: revamp output display) |
(Add ed example) |
||
Line 1,182: | Line 1,182: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
=={{header|Ed}}== |
|||
<syntaxhighlight lang="sed"> |
|||
H |
|||
g/^(.)\1*$/s//All the characters are the same in &/ |
|||
v/All the characters/s/.*/Not all characters are the same in &/ |
|||
,p |
|||
Q |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre>$ cat string-same.ed | ed -GlEs string-same.input |
|||
Newline appended |
|||
Not all characters are the same in |
|||
Not all characters are the same in |
|||
All the characters are the same in 2 |
|||
All the characters are the same in 333 |
|||
Not all characters are the same in .55 |
|||
Not all characters are the same in tttTTT |
|||
Not all characters are the same in 4444 444k</pre> |
|||
=={{header|Erlang|Erlang}}== |
=={{header|Erlang|Erlang}}== |