
641 S.E.2d 411 (2007)
In the Matter of B.N.S.
No. COA06-585.
Court of Appeals of North Carolina.
March 6, 2007.
Attorney General Roy Cooper, by Assistant Attorney General Barry H. Bloch, for the State.
Michelle FormyDuval Lynch, Whiteville, for juvenile-appellant.
*412 TYSON, Judge.
B.N.S. ("the juvenile") appeals from adjudication and dispositional orders entered finding him to be delinquent for possession of a weapon on a school campus or property. We affirm.

I. Background
On 26 October 2005, Randall Wells ("Wells"), the Assistant Principal of Southeast Raleigh Magnet High School, saw the juvenile standing in the stairwell wearing a hat. Wearing headgear is prohibited by school policy. Wells asked the juvenile to remove his hat. The juvenile refused. Wells asked the juvenile to accompany him to the school office.
The juvenile complied and followed Wells into the School Resource Office. Officers Boyce and Bloodworth were present in the School Resource Office. Wells asked the juvenile if he would consent to a search. The juvenile replied, "[g]o right ahead." Wells found a closed pocketknife located inside the juvenile's coat pocket. Wells testified that the pocketknife's blade was closed when he removed it. The trial court took judicial notice that the pocketknife's blade was 2.5 inches long.
The juvenile stated he had borrowed the coat that day and he did not know the pocketknife was inside the coat pocket. The juvenile was handcuffed and charged.
On 27 October 2005, a juvenile delinquency petition was filed against the juvenile for possession of a weapon on a school campus or property in violation of N.C. Gen.Stat. § 14-269.2(d). On 16 February 2006, the trial court adjudicated the juvenile to be delinquent for possession of a weapon on a school campus or property. The trial court entered a Level 2 disposition and ordered the juvenile be confined on an intermittent basis in an approved detention facility for a maximum of fourteen to twenty-four hour periods and that the juvenile serve three twenty-four hour periods in detention immediately following the juvenile's disposition date. The trial court also ordered the juvenile not associate with any known gang members or possess any gang paraphernalia. The juvenile appeals.

II. Issue
The juvenile argues the trial court erred when it denied the his motion to dismiss.

III. Standard of Review
The standard for ruling on a motion to dismiss is whether there is substantial evidence (1) of each essential element of the offense charged and (2) that defendant is the perpetrator of the offense. Substantial evidence is relevant evidence which a reasonable mind might accept as adequate to support a conclusion. In ruling on a motion to dismiss, the trial court must consider all of the evidence in the light most favorable to the State, and the State is entitled to all reasonable inferences which may be drawn from the evidence. Any contradictions or discrepancies arising from the evidence are properly left for the jury to resolve and do not warrant dismissal.
State v. Wood, 174 N.C.App. 790, 795, 622 S.E.2d 120, 123 (2005) (internal quotations omitted).

IV. Motion to Dismiss
The juvenile was adjudicated delinquent for possession of a weapon on a school campus or property. N.C. Gen.Stat. § 14-269.2(d) (2005) states:
(d) It shall be a Class 1 misdemeanor for any person to possess or carry, whether openly or concealed, any BB gun, stun gun, air rifle, air pistol, bowie knife, dirk, dagger, slungshot, leaded cane, switchblade knife, blackjack, metallic knuckles, razors and razor blades (except solely for personal shaving), firework, or any sharp-pointed or edged instrument except instructional supplies, unaltered nail files and clips and tools used solely for preparation of food, instruction, and maintenance, on educational property.
(Emphasis supplied). The juvenile argues a closed pocketknife is not a weapon under N.C. Gen.Stat. § 14-269.2(d).
Our Supreme Court stated in Brown v. Flowe, "Legislative intent controls the meaning of a statute. To determine *413 legislative intent, a court must analyze the statute as a whole, considering the chosen words themselves, the spirit of the act, and the objectives the statute seeks to accomplish." 349 N.C. 520, 522, 507 S.E.2d 894, 895 (1998) (citations omitted). "N.C. Gen. Stat. § 14-269.2, was enacted for the purpose of `deter[ring] students and others from bringing any type of [weapon] onto school grounds' because of `the increased necessity for safety in our schools.'" State v. Haskins, 160 N.C.App. 349, 352, 585 S.E.2d 766, 769 (quoting In re Cowley, 120 N.C.App. 274, 276, 461 S.E.2d 804, 806 (1995)), appeal dismissed, 357 N.C. 580, 589 S.E.2d 356 (2003).
N.C. Gen.Stat. § 14-269.2 does not require a showing of criminal intent. Id. "The question of operability is not relevant because the focus of the statute is the increased necessity for safety in our schools." In re Cowley, 120 N.C.App. at 276, 461 S.E.2d at 806.
This statute specifically exempts:
(1) a weapon used solely for education or school sanctioned ceremonial purposes, (2) a weapon used in a school-approved program conducted under the supervision of an adult whose supervision has been approved by the school authority, (3) firefighters, (4) emergency service personnel, (5) N.C. Forest Service personnel, (6) certain people, such as the military, law enforcement and the national guard, acting in their official capacity, (7) any private police employed by an educational institution when acting in the discharge of official duties, (8) home schools, or (9) a person who takes possession of a weapon from another person and immediately delivers the weapon, as soon as practicable, to law enforcement authorities.
Haskins, 160 N.C.App. at 354, 585 S.E.2d at 769-70; N.C. Gen.Stat. § 14-269.2(g) and (h) and § 14-269(b). "[T]he exemptions to N.C. Gen.Stat. § 14-269.2 bear a rational relationship to a legitimate government interest. . . . [to] strike an appropriate balance between the safety of our children and the furtherance of education in this state." Haskins, 160 N.C.App. at 354, 585 S.E.2d at 770.
None of the statutory exemptions apply to the facts before us. The juvenile possessed a pocketknife with a 2.5 inch blade while upon school property. "A pocketknife has been recognized in this state as a deadly or dangerous instrumentality as a matter of law." State v. Young, 317 N.C. 396, 417, 346 S.E.2d 626, 638 (1986). Although the knife's blade was closed, the operability of the weapon is irrelevant. Cowley, 120 N.C.App. at 276, 461 S.E.2d at 806. The juvenile possessed a "sharp-pointed or edged instrument" as prohibited by N.C. Gen.Stat. § 14-269.2(d) and merely had to open the pocketknife's blade. See id. (The trial court properly denied the juvenile's motion to dismiss even though his weapon was inoperable, unloaded, the juvenile did not possess bullets and the hammer had been filed and would not strike the firing pin.).
It is well established that the purpose of N.C. Gen.Stat. § 14-269.2 is to deter students from bringing a weapon onto school grounds. Haskins, 160 N.C.App. at 354, 585 S.E.2d at 769. After reviewing the evidence in the light most favorable to the State, the trial court did not err in denying the juvenile's motion to dismiss. The juvenile's assignment of error is overruled.

V. Conclusion
The trial court properly denied the juvenile's motion to dismiss. The State presented sufficient evidence tending to show the juvenile possessed a weapon on a school campus or property. The trial court's orders are affirmed.
Affirmed.
Judges ELMORE and GEER concur.
