当前位置:网站首页>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;
}
边栏推荐
- "Measuring curve length" of CAD dream drawing
- AutoCAD - workspace settings
- AutoCAD - isometric annotation
- AutoCAD - full screen display
- 775 Div.1 B. integral array mathematics
- #775 Div.1 B. Integral Array 数学
- Manually implement heap sorting -838 Heap sort
- Leetcode 222 number of nodes of complete binary tree
- #775 Div.1 C. Tyler and Strings 组合数学
- 次小生成树
猜你喜欢

XSS injection

Introduction to JVM principle and process

【acwing】240. food chain

Unity parallax infinite scrolling background

【acwing】837. Number of connected block points

54. Spiral matrix & 59 Spiral matrix II ●●

2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis

Autocad-- Real Time zoom

Use assimp library to read MTL file data

Unity get component
随机推荐
[groovy] closure (Introduction to closure class closure | closure parametertypes and maximumnumberofparameters member usage)
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
中国溶聚丁苯橡胶(SSBR)行业研究与预测报告(2022版)
Wan broadband access technology V EPON Technology
2021-10-29
[groovy] closure (closure call is associated with call method | call () method is defined in interface | call () method is defined in class | code example)
[ideas] 2021 may day mathematical modeling competition / May Day mathematical modeling ideas + references + codes
3dsmax snaps to frozen objects
中国针状焦行业发展研究与投资价值报告(2022版)
PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
【acwing】836. Merge sets
质量体系建设之路的分分合合
The 22nd Spring Festival Gala, an immersive stage for the yuan universe to shine into reality
MD5 bypass
Manually implement heap sorting -838 Heap sort
AutoCAD - workspace settings
2020-10-27
AutoCAD - continuous annotation
Unity and database
China polyurethane rigid foam Market Research and investment forecast report (2022 Edition)