Can't print a returned String from an object's function to Serial.print

Hello
Basically I have a class that returns a String of information.
However, I am encountering a problem where that string is not printed at all.

Here’s the code for the testing ino file:

#include <UltraSonicSensor.h>

UltraSonicSensor sonar;

void setup() {
 
String data = sonar.getConstantsInfo();
 Serial.begin(9600);
 Serial.print(sonar.getConstantsInfo());
 Serial.print(data);
}

void loop() {
 Serial.println(sonar.getConstantsInfo());
 Serial.println(sonar._ECHO_PIN);
}

and here’s my class file of UltraSonicSensor.cpp:

#include "Arduino.h"
#include "NewPing.h"
#include "UltraSonicSensor.h"


/*#define TRIGGER_PIN 12
#define ECHO_PIN
#define MAX_DISTANCE*/


/*UltraSonicSensor::UltraSonicSensor() {
    //UltraSonicSensor::_sonar = (12, 13, 400);
}*/


String UltraSonicSensor::getConstantsInfo() {
    return String("triggerpin" + _TRIGGER_PIN);
}

// /*UltraSonicSensor::UltraSonicSensor()
// {
//     _TRIGGER_PIN = 12;
//     _ECHO_PIN = 11;
//     _MAX_DISTANCE = 200;
//     //_solar = NewPing(12, 13, 400);
//     /*_solar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
//     _solar = NewPing::NewPing((uint_8t) 12, (uint_8t) 11, (unsigned int) 200);*/
// }*/

/*int UltraSonicSensor::getCurrentReading()
{
    return _solar.ping_cm();
}

bool UltraSonicSensor::hasDetectedContact()
{
    if(_solar.ping_cm() != 0)
        return true;
    else
        return false;
}*/

and here’s my class file of UltraSonicSensor.cpp

#ifndef UltraSonicSensor_h
#define UltraSonicSensor_h

#include "Arduino.h"
#include "NewPing.h"


#define TRIGGER_PIN 12
#define ECHO_PIN 11
#define MAX_DISTANCE 400


class UltraSonicSensor
{
public:
    UltraSonicSensor() : _TRIGGER_PIN(TRIGGER_PIN), _ECHO_PIN(ECHO_PIN), _MAX_DISTANCE(MAX_DISTANCE), _sonar(_TRIGGER_PIN, _ECHO_PIN, _MAX_DISTANCE) {}
    /*int getCurrentReading();
    bool hasDetectedContact();*/
    String getConstantsInfo();
    int _TRIGGER_PIN;
    int _ECHO_PIN;
    int _MAX_DISTANCE;
private:
    NewPing _sonar;
};

#endif

The weirdest things I noticed, is that it can print the int type just fine, but not the String object.

Most arduino users avoid the use of String (big S)
On the very small memory footprint available, corruption occurs.
Google it. It makes for an interesting read.

Use string (little s) instead.