A string trimmer, comprising: a trimming head; and a driving device comprising a motor for driving the trimming head to rotate around a rotation axis; wherein the trimming head comprises: a spool for winding a trimming line; a head housing formed with an accommodating space, wherein the spool is at least partially accommodated in the accommodating space; and a transmission member having a first position that prevents a relative rotation between the spool and the head housing relative to the spool and a second position that allows the relative rotation between the spool and the head housing relative to the spool; wherein the trimming head is in a working state and the transmission member rotates around the rotation axis synchronously with the spool when the transmission member is in the first position; the trimming head is in the autonomous line-feeding state and the relative rotation is generated between the spool and the head housing to feed the trimming line when the transmission member is in the second position; wherein when the trimming head is driven to rotate by the motor, the transmission member is subjected to a centrifugal force which cause a moving tendency in a direction from the first position to the second position; characterized in that when the head housing rotates around the rotation axis, the head housing also applies a resistance to the transmission member against the centrifugal force to prevent the transmission member from moving from the first position to the second position; when the trimming head is in a trimming state and the length of an effective portion of the trimming line extending beyond the head housing is less than a preset value, the resistance applied by the head housing to the transmission member is reduced so that the transmission member moves from the first position to the second position under the centrifugal force. a trimming head; and a driving device comprising a motor for driving the trimming head to rotate around a rotation axis; wherein the trimming head comprises: a spool for winding a trimming line; a head housing formed with an accommodating space, wherein the spool is at least partially accommodated in the accommodating space; and a transmission member having a first position that prevents a relative rotation between the spool and the head housing relative to the spool and a second position that allows the relative rotation between the spool and the head housing relative to the spool; a spool for winding a trimming line; a head housing formed with an accommodating space, wherein the spool is at least partially accommodated in the accommodating space; and a transmission member having a first position that prevents a relative rotation between the spool and the head housing relative to the spool and a second position that allows the relative rotation between the spool and the head housing relative to the spool; wherein the trimming head is in a working state and the transmission member rotates around the rotation axis synchronously with the spool when the transmission member is in the first position; the trimming head is in the autonomous line-feeding state and the relative rotation is generated between the spool and the head housing to feed the trimming line when the transmission member is in the second position; wherein when the trimming head is driven to rotate by the motor, the transmission member is subjected to a centrifugal force which cause a moving tendency in a direction from the first position to the second position; characterized in that when the head housing rotates around the rotation axis, the head housing also applies a resistance to the transmission member against the centrifugal force to prevent the transmission member from moving from the first position to the second position; when the trimming head is in a trimming state and the length of an effective portion of the trimming line extending beyond the head housing is less than a preset value, the resistance applied by the head housing to the transmission member is reduced so that the transmission member moves from the first position to the second position under the centrifugal force.