Skip to main content

Split String

Splits the current string into two or three parts, depending on the current selection or cursor position:

  • If nothing is selected, the string is split into two parts by the current cursor position.
  • If a part of a string is selected, the string is split into three parts: to the left of the selection, inside the selection, to the right of the selection.

#Availability

Available from the context menu or via shortcuts:

  • when the cursor is somewhere within a string.
  • when a part of a string is selected.

Note

If the selection includes the first or the last symbol of a string, the refactoring is unavailable.

#Notes

#Examples

string str = "My test string";
Dim str As String = "My test string"

Result:

string str = "My te" + "st string";
Dim str As String = "My te" + "st string"

#Screenshot

rsSplitString