我如何结束c ++这一行

时间:2018-03-26 23:24:53

标签: c++

我有一条很长的路线:

listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        // Get the selected item text from ListView
        String selectedItem = (String) parent.getItemAtPosition(position);

        // Display the selected item in a Toast
        Toast.makeText(view.getContext(), selectedItem, Toast.LENGTH_LONG).show();
    }
});

现在这个字符串变得非常长,我该如何以优雅的方式包裹该行?我试过断线,但它不起作用。我实际上不确定这是IDE问题还是编译器问题......请帮助!

1 个答案:

答案 0 :(得分:9)

尝试

const string a_string = "a long string "
                        "with \" .. with \" "
                        "again ... ... ";