Search Unity

¶ added to input fields

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by StefanAugmentors, Nov 1, 2018.

  1. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
    When ever I input text into TMP_InputField an invisible "¶" gets added at the end.

    Below is the settings on the input field.

    Screenshot_147.png
     
  2. Gambit-MSplitz

    Gambit-MSplitz

    Joined:
    May 16, 2015
    Posts:
    1,196
    Is it because you press 'enter' to finish editing the input field? If you know you'll never want that formatting mark, try trimming it off the string when the input field loses focus, or when you are about to use the string.
    Code (CSharp):
    1. inputField.text = inputField.text.TrimEnd('\r', '\n');
     
  3. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
    Yes I press enter on the mobile keyboard. I added trim to the string before sending it off to the server. However I'd like to know if there's a setting to stop it adding that formatting mark.