Implementation
Go

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
boolean b = s.matches("[0-9]*");
import "strings"
isNotDigit := func(c rune) bool { return c < '0' || c > '9' }
b := strings.IndexFunc(s, isNotDigit) == -1
var b = /^[0-9]*$/.test(s);
var
  S: String;
  C: Char;
  B: Boolean;

  for C in S do
  begin
    B := C in ['0'..'9'];
    if not B then Break;
  end;
std.algorithm.iteration;
std.ascii;
bool b = s.filter!(a => !isDigit(a)).empty;
import std.ascii;
import std.algorithm;
bool b = s.all!isDigit;
b = s.count("^0-9").zero?
b = s.isdigit()
b = tonumber(s) ~= nil
import Data.Char
b = all isDigit s
let chars_are_numeric: Vec<bool> = s.chars()
				.map(|c|c.is_numeric())
				.collect();
let b = !chars_are_numeric.contains(&false);
let b = s.chars().all(char::is_numeric);
my $b = $s =~ /^\d*$/;
$b = preg_match('/\D/', $s) !== 1;