Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- public class UIController : MonoBehaviour
- {
- private string _mailForm = "@gmail.com";
- private string _mailCheck;
- private InputField _inputField;
- private void Start()
- {
- _inputField = gameObject.GetComponentInChildren(typeof(InputField)) as InputField;
- }
- public void ApplyButton()
- {
- if (_inputField.text.Length > _mailForm.Length && _inputField.text.EndsWith(_mailForm))
- {
- // Debug.Log(_inputField.text);
- }
- ApplyButton2();
- }
- public void ApplyButton2()
- {
- int _countCheckValue = 0;
- for (int i = _inputField.text.Length - _mailForm.Length; i < _inputField.text.Length; i++)
- {
- if (_inputField.text[i] == _mailForm[i - (_inputField.text.Length - _mailForm.Length)])
- {
- _countCheckValue++;
- }
- }
- if (_countCheckValue == _mailForm.Length && _mailForm.Length != _inputField.text.Length)
- {
- Debug.Log(_inputField.text);
- }
- else
- Debug.Log("error");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement