---
layout: doc
title: strings / test_bit
---
# test_bit

### NAME

    set_bit() - set a bit in a bitstring

### SYNOPSIS

    int test_bit( string str, int n );

### DESCRIPTION

    Return 0 or 1 of bit 'n' was set in string 'str'.

### SEE ALSO

    set_bit(3), clear_bit(3)

