Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python count characters

# Basic syntax:
import re
len(re.findall('[characters]', your_string))

# Example usage:
# say you want to count all G, g, C, or c characters in the following DNA seq
len(re.findall('[GgCc]', "ACGTGCAcgattcgatCGCTAGCTAG"))
--> 14
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #count #characters
ADD COMMENT
Topic
Name
8+4 =