Any shortcut for select current string in Visual Studio?

周 瑶 41 Reputation points
2023-04-06T05:04:10.4166667+00:00

If the cursor locates in a string "abcde abcd", is there any shortcut to fastly select the whole string?

Developer technologies Visual Studio Other
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2023-04-06T06:17:45.7+00:00

    Hello @周 瑶,

    Welcome to Microsoft Q&A forum.

    There are several scenarios.

    For string in code between quotes like Console.WriteLine("abcde abcd");

    The first scenario:

    Focus cursor on abcde, press Ctrl + W, the word abcde will be selected.

    Focus cursor on abcd, press Ctrl + W, the word abcd will be selected.

    User's image

    The second scenario:

    Focus cursor on abcde, press Alt + Shift + =, the string with quotes "abcde abcd" will be selected.

    Focus cursor on abcd, press Alt + Shift + =, the string with quotes "abcde abcd" will be selected. User's image

    The third scenario:

    Focus cursor on abcde, but before character a, press Alt + Shift + Right Arrow, character a will be selected, continue pressing Alt + Shift + Right Arrow, characters ab will be selected…

    User's image

    Please feel free to let us know if you have any further concerns.

    Sincerely,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2023-04-06T05:38:47.3+00:00

    Try Shift Alt =.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.