How to get the world position of the edge of an object?

C#
Vector3 offset = transform.up * (transform.localScale.y / 2f) * -1f; 
Vector3 pos = transform.position + offset; //This is the position
Source

Also in C#: