当前位置:网站首页>Unity sends messages and blocks indecent words
Unity sends messages and blocks indecent words
2022-07-05 04:55:00 【yaohuiyaoo】
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Test : MonoBehaviour {
Text text;
Button btn;
InputField inout;
string temp;
void Start () {
temp = null;
text = transform.GetChild(0).GetComponent
btn = transform.GetChild(1).GetComponent();
inout = transform.GetChild(2).GetComponent();
btn.onClick.AddListener(Send);
}
string mm;
void Send()
{
string s =inout.text;
List list = new List();
list.Add(“ Bad guys ”);
list.Add(“ A fool ”);
for(int i = 0; i < list.Count; i++)
{
for (int j = 0; j< s.Length; j++)
{
temp = temp + s[j];
//print(temp);
for (int z =j+1; z < s.Length; z++)
{
temp = temp+s[z];
print(temp);
if (temp.Equals(list[i]))
{
int y = z - j;
mm= s.Replace(temp,Change(y));
break;
}
}
temp = null;
}
}
text.text = mm;
}
private string Change(int y)
{
string s = null;
for (int i = 0; i <=y; i++)
{
s = s + "*";
}
return s;
}
边栏推荐
- 2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis
- XSS injection
- mysql審計日志歸檔
- Emlog博客主题模板源码简约好看响应式
- [crampon programming] lintcode decoding Encyclopedia - 872 termination process
- 2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
- Common technologies of unity
- English topic assignment (27)
- PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
- 2021 electrician Cup - high speed rail traction power supply system operation data analysis and equivalent modeling ideas + code
猜你喜欢

AutoCAD - command repetition, undo and redo

PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low

On-off and on-off of quality system construction

2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem

3dsmax scanning function point connection drawing connection line

Establish cloth effect in 10 seconds

Solutions and answers for the 2021 Shenzhen cup
![[AI bulletin 20220211] the hard core up owner has built a lidar and detailed AI accelerator](/img/cc/06580ce7b553182968d273841a78b4.jpg)
[AI bulletin 20220211] the hard core up owner has built a lidar and detailed AI accelerator

Unity parallax infinite scrolling background

Thematic information | carbon, carbon neutrality, low carbon, carbon emissions - 22.1.9
随机推荐
On-off and on-off of quality system construction
flutter 对象和列表
2021 electrician Cup - high speed rail traction power supply system operation data analysis and equivalent modeling ideas + code
Mode in BST (binary tree & Notes on question brushing)
中国金刚烷行业研究与投资预测报告(2022版)
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
The first topic of ape Anthropology
China polyurethane rigid foam Market Research and investment forecast report (2022 Edition)
2021 higher education social cup mathematical modeling national tournament ABCD questions - problem solving ideas - Mathematical Modeling
#775 Div.1 B. Integral Array 数学
AutoCAD - Center zoom
Unity get component
XSS injection
猿人学第一题
[Business Research Report] top ten trends of science and technology and it in 2022 - with download link
Unity and database
AutoCAD - scaling
This article is good
Variable category (automatic, static, register, external)