#include <string> 
#include <cstdio> 

int main() 
{ 
  std::wstring s = L"Hello"; 
  s += L", world!"; 
  std::printf("%ls\n", s.c_str()); 

  std::string::size_type idx = s.find(L"world"); 
  if (idx != std::string::npos) 
  { 
    s.replace(idx, 5, L"moon"); 
    std::printf("%ls\n", s.c_str()); 
  } 
} 